@seafile/sdoc-editor 0.5.74 → 0.5.75
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/extension/plugins/paragraph/render-elem.js +8 -3
- package/dist/basic-sdk/extension/toolbar/side-toolbar/index.css +12 -2
- package/dist/basic-sdk/extension/toolbar/side-toolbar/index.js +13 -3
- package/package.json +2 -1
- package/public/locales/cs/sdoc-editor.json +4 -3
- package/public/locales/de/sdoc-editor.json +4 -3
- package/public/locales/es/sdoc-editor.json +4 -3
- package/public/locales/es_AR/sdoc-editor.json +4 -3
- package/public/locales/es_MX/sdoc-editor.json +4 -3
- package/public/locales/fr/sdoc-editor.json +4 -3
- package/public/locales/it/sdoc-editor.json +4 -3
- package/public/locales/ru/sdoc-editor.json +5 -4
- package/public/locales/zh_CN/sdoc-editor.json +4 -3
- package/public/media/sdoc-editor-font/iconfont.eot +0 -0
- package/public/media/sdoc-editor-font/iconfont.svg +2 -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 +4 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Node } from '@seafile/slate';
|
|
4
|
-
import { useSlateStatic } from '@seafile/slate-react';
|
|
3
|
+
import { Node, Range } from '@seafile/slate';
|
|
4
|
+
import { useSelected, useSlateStatic } from '@seafile/slate-react';
|
|
5
5
|
import { Placeholder } from '../../core';
|
|
6
6
|
import { isEmptyNode } from './helper';
|
|
7
|
-
import { COMMENT_EDITOR } from '../../../constants';
|
|
7
|
+
import { COMMENT_EDITOR, WIKI_EDITOR } from '../../../constants';
|
|
8
8
|
const PLACEHOLDER = 'Please_enter_text';
|
|
9
9
|
const Paragraph = _ref => {
|
|
10
10
|
let {
|
|
@@ -19,7 +19,9 @@ const Paragraph = _ref => {
|
|
|
19
19
|
indent
|
|
20
20
|
} = element;
|
|
21
21
|
const editor = useSlateStatic();
|
|
22
|
+
const isSelected = useSelected();
|
|
22
23
|
const isCommentEditor = editor.editorType === COMMENT_EDITOR;
|
|
24
|
+
const isWikiEditor = editor.editorType === WIKI_EDITOR;
|
|
23
25
|
let isShowPlaceHolder = false;
|
|
24
26
|
if (editor.children.length === 1) {
|
|
25
27
|
const node = editor.children[0];
|
|
@@ -31,6 +33,9 @@ const Paragraph = _ref => {
|
|
|
31
33
|
const node = editor.children[1];
|
|
32
34
|
isShowPlaceHolder = Node.string(element) === '' && (node === null || node === void 0 ? void 0 : node.id) === (element === null || element === void 0 ? void 0 : element.id) && !isComposing;
|
|
33
35
|
}
|
|
36
|
+
if (isSelected && isWikiEditor && Range.isCollapsed(editor.selection) && isEmptyNode(element)) {
|
|
37
|
+
isShowPlaceHolder = true;
|
|
38
|
+
}
|
|
34
39
|
const style = {
|
|
35
40
|
textAlign: element.align,
|
|
36
41
|
paddingTop: '5px',
|
|
@@ -2,15 +2,25 @@
|
|
|
2
2
|
position: absolute;
|
|
3
3
|
left: 0px;
|
|
4
4
|
top: 0px;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
width: 24px;
|
|
9
|
+
height: 24px;
|
|
10
|
+
border-radius: 3px;
|
|
11
|
+
transition: all 0.2s;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.sdoc-side-toolbar-container:hover {
|
|
15
|
+
background-color: #EFEFEF;
|
|
5
16
|
}
|
|
6
17
|
|
|
7
18
|
.sdoc-side-toolbar-container .sdoc-side-op-icon {
|
|
8
19
|
border-radius: 3px;
|
|
9
20
|
padding: 0px 3px;
|
|
10
21
|
height: 24px;
|
|
11
|
-
color: #
|
|
22
|
+
color: #AFAFAD;
|
|
12
23
|
margin-right: 1px;
|
|
13
|
-
transform: rotate(180deg);
|
|
14
24
|
cursor: pointer;
|
|
15
25
|
}
|
|
16
26
|
|
|
@@ -23,6 +23,7 @@ const SideToolbar = () => {
|
|
|
23
23
|
const [isNodeEmpty, setNodeEmpty] = useState(false);
|
|
24
24
|
const [isShowSideMenu, setShowSideMenu] = useState(false);
|
|
25
25
|
const [menuPosition, setMenuPosition] = useState({});
|
|
26
|
+
const [isEnterMoreVertical, setIsEnterMoreVertical] = useState(false);
|
|
26
27
|
const sideMenuRef = useRef();
|
|
27
28
|
const onReset = useCallback(() => {
|
|
28
29
|
setShowSideMenu(false);
|
|
@@ -241,6 +242,12 @@ const SideToolbar = () => {
|
|
|
241
242
|
unSubscribeDrop();
|
|
242
243
|
};
|
|
243
244
|
}, [dragLeave, dragOver, drop]);
|
|
245
|
+
const onMouseEnter = useCallback(() => {
|
|
246
|
+
setIsEnterMoreVertical(true);
|
|
247
|
+
}, []);
|
|
248
|
+
const onMouseLeave = useCallback(() => {
|
|
249
|
+
setIsEnterMoreVertical(false);
|
|
250
|
+
}, []);
|
|
244
251
|
return /*#__PURE__*/React.createElement("div", {
|
|
245
252
|
className: "sdoc-side-toolbar-container",
|
|
246
253
|
style: sidePosition
|
|
@@ -249,11 +256,14 @@ const SideToolbar = () => {
|
|
|
249
256
|
draggable: true,
|
|
250
257
|
onDragStart: dragStart,
|
|
251
258
|
className: "sdoc-side-op-icon",
|
|
252
|
-
onClick: onShowSideMenuToggle
|
|
259
|
+
onClick: onShowSideMenuToggle,
|
|
260
|
+
onMouseEnter: onMouseEnter,
|
|
261
|
+
onMouseLeave: onMouseLeave
|
|
253
262
|
}, /*#__PURE__*/React.createElement("span", {
|
|
254
263
|
className: classnames('sdocfont', {
|
|
255
|
-
'sdoc-more-vertical': !isNodeEmpty,
|
|
256
|
-
'sdoc-append': isNodeEmpty
|
|
264
|
+
'sdoc-more-vertical': !isNodeEmpty && !isEnterMoreVertical,
|
|
265
|
+
'sdoc-append': isNodeEmpty,
|
|
266
|
+
'sdoc-more-vertical-left': !isNodeEmpty && isEnterMoreVertical
|
|
257
267
|
})
|
|
258
268
|
})), isShowSideMenu && /*#__PURE__*/React.createElement(SideMenu, {
|
|
259
269
|
slateNode: slateNode,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seafile/sdoc-editor",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.75",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "This is a sdoc editor",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -97,6 +97,7 @@
|
|
|
97
97
|
"css-minimizer-webpack-plugin": "5.0.1",
|
|
98
98
|
"dotenv": "6.2.0",
|
|
99
99
|
"dotenv-expand": "5.1.0",
|
|
100
|
+
"dtable-utils": "5.0.1",
|
|
100
101
|
"ejs": "3.1.10",
|
|
101
102
|
"eslint": "6.8.0",
|
|
102
103
|
"eslint-config-react-app": "^5.0.2",
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"Delete_row": "Delete row",
|
|
44
44
|
"Delete_column": "Delete column",
|
|
45
45
|
"Insert_row": "Vložit řádek",
|
|
46
|
-
"Insert_column": "Vložit sloupec",
|
|
47
46
|
"Set_align": "Nastavit zarovnání",
|
|
48
47
|
"Left": "Vlevo",
|
|
49
48
|
"Center": "Střed",
|
|
@@ -461,5 +460,7 @@
|
|
|
461
460
|
"Fit_table_to_page_width": "Fit table to page width",
|
|
462
461
|
"Enter_text_or_press_forward_slash_to_insert_element": "Enter text or press '/' to insert element",
|
|
463
462
|
"Vertical_align": "Vertical alignment",
|
|
464
|
-
"Horizontal_align": "Horizontal alignment"
|
|
465
|
-
|
|
463
|
+
"Horizontal_align": "Horizontal alignment",
|
|
464
|
+
"SeaTable_column": "SeaTable column",
|
|
465
|
+
"SeaTable_view": "SeaTable view"
|
|
466
|
+
}
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"Delete_row": "Delete row",
|
|
44
44
|
"Delete_column": "Delete column",
|
|
45
45
|
"Insert_row": "Zeile einfügen",
|
|
46
|
-
"Insert_column": "Spalte einfügen",
|
|
47
46
|
"Set_align": "Ausrichtung festlegen",
|
|
48
47
|
"Left": "Links",
|
|
49
48
|
"Center": "Zentrieren",
|
|
@@ -461,5 +460,7 @@
|
|
|
461
460
|
"Fit_table_to_page_width": "Fit table to page width",
|
|
462
461
|
"Enter_text_or_press_forward_slash_to_insert_element": "Enter text or press '/' to insert element",
|
|
463
462
|
"Vertical_align": "Vertical alignment",
|
|
464
|
-
"Horizontal_align": "Horizontal alignment"
|
|
465
|
-
|
|
463
|
+
"Horizontal_align": "Horizontal alignment",
|
|
464
|
+
"SeaTable_column": "SeaTable column",
|
|
465
|
+
"SeaTable_view": "SeaTable view"
|
|
466
|
+
}
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"Delete_row": "Delete row",
|
|
44
44
|
"Delete_column": "Delete column",
|
|
45
45
|
"Insert_row": "Insert row",
|
|
46
|
-
"Insert_column": "Insert column",
|
|
47
46
|
"Set_align": "Establecer alineación",
|
|
48
47
|
"Left": "Izquierda",
|
|
49
48
|
"Center": "Centrar",
|
|
@@ -461,5 +460,7 @@
|
|
|
461
460
|
"Fit_table_to_page_width": "Fit table to page width",
|
|
462
461
|
"Enter_text_or_press_forward_slash_to_insert_element": "Enter text or press '/' to insert element",
|
|
463
462
|
"Vertical_align": "Vertical alignment",
|
|
464
|
-
"Horizontal_align": "Horizontal alignment"
|
|
465
|
-
|
|
463
|
+
"Horizontal_align": "Horizontal alignment",
|
|
464
|
+
"SeaTable_column": "SeaTable column",
|
|
465
|
+
"SeaTable_view": "SeaTable view"
|
|
466
|
+
}
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"Delete_row": "Delete row",
|
|
44
44
|
"Delete_column": "Delete column",
|
|
45
45
|
"Insert_row": "Insert row",
|
|
46
|
-
"Insert_column": "Insert column",
|
|
47
46
|
"Set_align": "Establecer alineación",
|
|
48
47
|
"Left": "Izquierda",
|
|
49
48
|
"Center": "Centrar",
|
|
@@ -461,5 +460,7 @@
|
|
|
461
460
|
"Fit_table_to_page_width": "Fit table to page width",
|
|
462
461
|
"Enter_text_or_press_forward_slash_to_insert_element": "Enter text or press '/' to insert element",
|
|
463
462
|
"Vertical_align": "Vertical alignment",
|
|
464
|
-
"Horizontal_align": "Horizontal alignment"
|
|
465
|
-
|
|
463
|
+
"Horizontal_align": "Horizontal alignment",
|
|
464
|
+
"SeaTable_column": "SeaTable column",
|
|
465
|
+
"SeaTable_view": "SeaTable view"
|
|
466
|
+
}
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"Delete_row": "Delete row",
|
|
44
44
|
"Delete_column": "Delete column",
|
|
45
45
|
"Insert_row": "Insert row",
|
|
46
|
-
"Insert_column": "Insert column",
|
|
47
46
|
"Set_align": "Establecer alineación",
|
|
48
47
|
"Left": "Izquierda",
|
|
49
48
|
"Center": "Centrar",
|
|
@@ -461,5 +460,7 @@
|
|
|
461
460
|
"Fit_table_to_page_width": "Fit table to page width",
|
|
462
461
|
"Enter_text_or_press_forward_slash_to_insert_element": "Enter text or press '/' to insert element",
|
|
463
462
|
"Vertical_align": "Vertical alignment",
|
|
464
|
-
"Horizontal_align": "Horizontal alignment"
|
|
465
|
-
|
|
463
|
+
"Horizontal_align": "Horizontal alignment",
|
|
464
|
+
"SeaTable_column": "SeaTable column",
|
|
465
|
+
"SeaTable_view": "SeaTable view"
|
|
466
|
+
}
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"Delete_row": "Supprimer la ligne",
|
|
44
44
|
"Delete_column": "Supprimer la colonne",
|
|
45
45
|
"Insert_row": "Insérer une ligne",
|
|
46
|
-
"Insert_column": "Insérer une colonne",
|
|
47
46
|
"Set_align": "Ajuster l'alignement",
|
|
48
47
|
"Left": "Gauche",
|
|
49
48
|
"Center": "Centrer",
|
|
@@ -461,5 +460,7 @@
|
|
|
461
460
|
"Fit_table_to_page_width": "Fit table to page width",
|
|
462
461
|
"Enter_text_or_press_forward_slash_to_insert_element": "Enter text or press '/' to insert element",
|
|
463
462
|
"Vertical_align": "Vertical alignment",
|
|
464
|
-
"Horizontal_align": "Horizontal alignment"
|
|
465
|
-
|
|
463
|
+
"Horizontal_align": "Horizontal alignment",
|
|
464
|
+
"SeaTable_column": "SeaTable column",
|
|
465
|
+
"SeaTable_view": "SeaTable view"
|
|
466
|
+
}
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"Delete_row": "Delete row",
|
|
44
44
|
"Delete_column": "Delete column",
|
|
45
45
|
"Insert_row": "Insert row",
|
|
46
|
-
"Insert_column": "Insert column",
|
|
47
46
|
"Set_align": "Imposta allineamento",
|
|
48
47
|
"Left": "Sinistra",
|
|
49
48
|
"Center": "Centrato",
|
|
@@ -461,5 +460,7 @@
|
|
|
461
460
|
"Fit_table_to_page_width": "Fit table to page width",
|
|
462
461
|
"Enter_text_or_press_forward_slash_to_insert_element": "Enter text or press '/' to insert element",
|
|
463
462
|
"Vertical_align": "Vertical alignment",
|
|
464
|
-
"Horizontal_align": "Horizontal alignment"
|
|
465
|
-
|
|
463
|
+
"Horizontal_align": "Horizontal alignment",
|
|
464
|
+
"SeaTable_column": "SeaTable column",
|
|
465
|
+
"SeaTable_view": "SeaTable view"
|
|
466
|
+
}
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"Delete_row": "Удалить строку",
|
|
44
44
|
"Delete_column": "Удалить столбец",
|
|
45
45
|
"Insert_row": "Вставить строку",
|
|
46
|
-
"Insert_column": "Вставить столбец",
|
|
47
46
|
"Set_align": "Установить выравнивание",
|
|
48
47
|
"Left": "Слева",
|
|
49
48
|
"Center": "По центру",
|
|
@@ -445,7 +444,7 @@
|
|
|
445
444
|
"Recent_visited": "Недавно посещенные",
|
|
446
445
|
"The_document_does_not_exist": "Документ не существует",
|
|
447
446
|
"Create_a_new_sdoc_file": "Создать новый файл sdoc",
|
|
448
|
-
"New_page": "
|
|
447
|
+
"New_page": "Новая страница",
|
|
449
448
|
"Create": "Создать",
|
|
450
449
|
"Top_align": "Верх",
|
|
451
450
|
"Center_align": "Середина",
|
|
@@ -461,5 +460,7 @@
|
|
|
461
460
|
"Fit_table_to_page_width": "Подогнать таблицу по ширине страницы",
|
|
462
461
|
"Enter_text_or_press_forward_slash_to_insert_element": "Введите текст или нажмите '/', чтобы вставить элемент",
|
|
463
462
|
"Vertical_align": "Вертикальное выравнивание",
|
|
464
|
-
"Horizontal_align": "Горизонтальное выравнивание"
|
|
465
|
-
|
|
463
|
+
"Horizontal_align": "Горизонтальное выравнивание",
|
|
464
|
+
"SeaTable_column": "SeaTable column",
|
|
465
|
+
"SeaTable_view": "SeaTable view"
|
|
466
|
+
}
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"Delete_row": "删除当前行",
|
|
44
44
|
"Delete_column": "删除当前列",
|
|
45
45
|
"Insert_row": "插入行",
|
|
46
|
-
"Insert_column": "插入列",
|
|
47
46
|
"Set_align": "对齐方式",
|
|
48
47
|
"Left": "左对齐",
|
|
49
48
|
"Center": "居中",
|
|
@@ -461,5 +460,7 @@
|
|
|
461
460
|
"Fit_table_to_page_width": "自动适应页面宽度",
|
|
462
461
|
"Enter_text_or_press_forward_slash_to_insert_element": "输入文本或按下 '/' 插入元素",
|
|
463
462
|
"Vertical_align": "垂直对齐",
|
|
464
|
-
"Horizontal_align": "水平对齐"
|
|
465
|
-
|
|
463
|
+
"Horizontal_align": "水平对齐",
|
|
464
|
+
"SeaTable_column": "SeaTable 列",
|
|
465
|
+
"SeaTable_view": "SeaTable 视图"
|
|
466
|
+
}
|
|
Binary file
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
/>
|
|
15
15
|
<missing-glyph />
|
|
16
16
|
|
|
17
|
+
<glyph glyph-name="sdoc-more-vertical-left" unicode="" d="M703.629257 704.370743c-54.294956 0-95.814629 41.519672-95.814628 95.814628s41.519672 95.814629 95.814628 95.814629 95.814629-41.519672 95.814629-95.814629-41.519672-95.814629-95.814629-95.814628z m0-415.196724c-54.294956 0-95.814629 41.519672-95.814628 95.814628s41.519672 95.814629 95.814628 95.814629 95.814629-41.519672 95.814629-95.814629-41.519672-95.814629-95.814629-95.814628z m0-415.196724c-54.294956 0-95.814629 41.519672-95.814628 95.814628s41.519672 95.814629 95.814628 95.814629 95.814629-41.519672 95.814629-95.814629-41.519672-95.814629-95.814629-95.814628zM310.78928 857.674149L16.957752 432.895962c-19.162926-28.744389-19.162926-76.651703 0-105.396092L310.78928-94.084496c19.162926-28.744389 60.682598-44.713493 89.426987-25.550568 28.744389 22.356747 38.325851 63.876419 19.162925 92.620808L125.547665 381.794826l287.443885 405.615262c25.550568 35.13203 25.550568 73.457882-12.775283 95.814628s-67.07024 3.193821-89.426987-25.550567z" horiz-adv-x="1024" />
|
|
18
|
+
|
|
17
19
|
<glyph glyph-name="sdoc-seatable-view" unicode="" d="M384 896c35.2 0 64-28.8 64-64v-320c0-35.2-28.8-64-64-64H64c-35.2 0-64 28.8-64 64V832C0 867.2 28.8 896 64 896h320z m-32-96H96v-256h256V800z m608 96c35.2 0 64-28.8 64-64v-320c0-35.2-28.8-64-64-64H640c-35.2 0-64 28.8-64 64V832c0 35.2 28.8 64 64 64h320z m-32-96h-256v-256h256V800zM384 320c35.2 0 64-28.8 64-64v-320c0-35.2-28.8-64-64-64H64c-35.2 0-64 28.8-64 64V256c0 35.2 28.8 64 64 64h320z m-32-96H96v-256h256v256z m608 96c35.2 0 64-28.8 64-64v-320c0-35.2-28.8-64-64-64H640c-35.2 0-64 28.8-64 64V256c0 35.2 28.8 64 64 64h320z m-32-96h-256v-256h256v256z" horiz-adv-x="1024" />
|
|
18
20
|
|
|
19
21
|
<glyph glyph-name="sdoc-text-style" unicode="" d="M147.2 156.8h160l67.2 153.6h278.4L720 156.8h160L598.4 896H428.8L147.2 156.8z m348.8 512h35.2l83.2-227.2H409.6L496 668.8zM774.4-128V32h160v-160h-160zM419.2 32h160v-160h-160V32zM96 32h160v-160H96V32z" horiz-adv-x="1024" />
|
|
Binary file
|
|
Binary file
|
|
Binary file
|