@seafile/sdoc-editor 0.4.9 → 0.4.11
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/blockquote/helpers.js +1 -2
- package/dist/basic-sdk/extension/plugins/blockquote/menu/index.js +2 -0
- package/dist/basic-sdk/extension/plugins/blockquote/plugin.js +3 -4
- package/dist/basic-sdk/extension/plugins/markdown/plugin.js +2 -5
- package/dist/basic-sdk/extension/plugins/search-replace/popover/index.js +1 -0
- package/dist/components/doc-operations/more-operations.js +1 -1
- package/package.json +1 -1
- package/public/locales/cs/sdoc-editor.json +1 -1
- package/public/locales/de/sdoc-editor.json +1 -1
- package/public/locales/en/sdoc-editor.json +1 -1
- package/public/locales/es/sdoc-editor.json +1 -1
- package/public/locales/fr/sdoc-editor.json +1 -1
- package/public/locales/it/sdoc-editor.json +1 -1
- package/public/locales/ru/sdoc-editor.json +9 -9
- package/public/locales/zh_CN/sdoc-editor.json +1 -1
|
@@ -2,7 +2,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
2
2
|
import { Editor, Transforms, Element } from '@seafile/slate';
|
|
3
3
|
import slugid from 'slugid';
|
|
4
4
|
import { BLOCKQUOTE, CHECK_LIST_ITEM, IMAGE, ORDERED_LIST, PARAGRAPH, UNORDERED_LIST, CODE_BLOCK, TABLE, CALL_OUT } from '../../constants';
|
|
5
|
-
import {
|
|
5
|
+
import { getNodeType } from '../../core';
|
|
6
6
|
export const isMenuDisabled = (editor, readonly) => {
|
|
7
7
|
if (readonly) return true;
|
|
8
8
|
if (editor.selection == null) return true;
|
|
@@ -64,7 +64,6 @@ export const setBlockQuoteType = (editor, active) => {
|
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
focusEditor(editor);
|
|
68
67
|
};
|
|
69
68
|
export const getFormattedElements = data => {
|
|
70
69
|
const elements = [];
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { BLOCKQUOTE, MENUS_CONFIG_MAP } from '../../../constants';
|
|
4
4
|
import { MenuItem } from '../../../commons';
|
|
5
5
|
import { getBlockQuoteType, isMenuDisabled, setBlockQuoteType } from '../helpers';
|
|
6
|
+
import { focusEditor } from '../../../core';
|
|
6
7
|
class QuoteMenu extends React.Component {
|
|
7
8
|
constructor() {
|
|
8
9
|
super(...arguments);
|
|
@@ -25,6 +26,7 @@ class QuoteMenu extends React.Component {
|
|
|
25
26
|
} = this.props;
|
|
26
27
|
const active = this.isActive(editor);
|
|
27
28
|
setBlockQuoteType(editor, active);
|
|
29
|
+
focusEditor(editor);
|
|
28
30
|
};
|
|
29
31
|
}
|
|
30
32
|
render() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Editor, Element, Transforms, Node } from '@seafile/slate';
|
|
1
|
+
import { Editor, Element, Transforms, Node, Path } from '@seafile/slate';
|
|
2
2
|
import { focusEditor, generateDefaultText, getSelectedNodeByType, isSelectionAtBlockStart } from '../../core';
|
|
3
3
|
import { BLOCKQUOTE, PARAGRAPH, CODE_BLOCK, TABLE } from '../../constants';
|
|
4
4
|
import { setBlockQuoteType, getFormattedElements, getFormattedRestElements } from './helpers';
|
|
@@ -27,12 +27,11 @@ const withBlockquote = editor => {
|
|
|
27
27
|
const isAtEnd = currentLineEntry[1].slice(-1)[0] === quoteBlockEntry[0].children.length - 1;
|
|
28
28
|
if (isAtEnd) {
|
|
29
29
|
const isEmptyLine = !(currentLineEntry && Editor.string(newEditor, currentLineEntry[1]).length);
|
|
30
|
-
const movePath = quoteBlockEntry[1];
|
|
31
|
-
movePath.push(movePath.pop() + 1);
|
|
32
30
|
if (isEmptyLine) {
|
|
31
|
+
const nextPath = Path.next(quoteBlockEntry[1]);
|
|
33
32
|
Transforms.moveNodes(newEditor, {
|
|
34
33
|
at: currentLineEntry[1],
|
|
35
|
-
to:
|
|
34
|
+
to: nextPath
|
|
36
35
|
});
|
|
37
36
|
return;
|
|
38
37
|
}
|
|
@@ -3,6 +3,7 @@ import { Editor, Transforms, Range } from '@seafile/slate';
|
|
|
3
3
|
import { toggleList } from '../list/transforms';
|
|
4
4
|
import { getSelectedNodeByType } from '../../core';
|
|
5
5
|
import { HEADER1, HEADER2, HEADER3, HEADER4, HEADER5, HEADER6, UNORDERED_LIST, BLOCKQUOTE, TEXT_STYLE_MAP, PARAGRAPH } from '../../constants';
|
|
6
|
+
import { setBlockQuoteType } from '../blockquote/helpers';
|
|
6
7
|
const KEY_TO_TYPE_FOR_SPACE = {
|
|
7
8
|
// Title shortcut
|
|
8
9
|
'#': HEADER1,
|
|
@@ -163,11 +164,7 @@ const withMarkDown = editor => {
|
|
|
163
164
|
return;
|
|
164
165
|
}
|
|
165
166
|
if (type === BLOCKQUOTE) {
|
|
166
|
-
|
|
167
|
-
type
|
|
168
|
-
}, {
|
|
169
|
-
mode: 'highest'
|
|
170
|
-
});
|
|
167
|
+
setBlockQuoteType(editor, false);
|
|
171
168
|
return;
|
|
172
169
|
}
|
|
173
170
|
Transforms.setNodes(editor, {
|
|
@@ -80,6 +80,7 @@ const SearchReplacePopover = _ref => {
|
|
|
80
80
|
}, [editor, handleDrawHighlight, handleDrawHighlightLister, highlightInfos.length, searchContent]);
|
|
81
81
|
const handleSearchInputChange = useCallback(e => {
|
|
82
82
|
const keyword = e.target.value;
|
|
83
|
+
shouldScrollIntoView.current = true;
|
|
83
84
|
setSearchContent(keyword);
|
|
84
85
|
handleDrawHighlight(editor, keyword);
|
|
85
86
|
setCurrentSelectIndex(0);
|
|
@@ -54,7 +54,7 @@ const MoreOperations = _ref => {
|
|
|
54
54
|
}, t('Unfreeze')), isPro && !isFreezed && /*#__PURE__*/React.createElement(DropdownItem, {
|
|
55
55
|
className: "sdoc-dropdown-menu-item",
|
|
56
56
|
onClick: onFreezeDocument
|
|
57
|
-
}, t('
|
|
57
|
+
}, t('Freeze_document')), /*#__PURE__*/React.createElement(DropdownItem, {
|
|
58
58
|
className: "sdoc-dropdown-menu-item",
|
|
59
59
|
onClick: handleClickHistory
|
|
60
60
|
}, t('Document_history'))));
|
package/package.json
CHANGED
|
@@ -427,7 +427,7 @@
|
|
|
427
427
|
"Other_modification": "Other's modification",
|
|
428
428
|
"My_modification": "My modification",
|
|
429
429
|
"Document_history": "Document history",
|
|
430
|
-
"
|
|
430
|
+
"Freeze_document": "Freeze document",
|
|
431
431
|
"Unfreeze": "Unfreeze",
|
|
432
432
|
"Search_and_replace": "Search and replace",
|
|
433
433
|
"Search": "Hledat",
|
|
@@ -427,7 +427,7 @@
|
|
|
427
427
|
"Other_modification": "Other's modification",
|
|
428
428
|
"My_modification": "My modification",
|
|
429
429
|
"Document_history": "Document history",
|
|
430
|
-
"
|
|
430
|
+
"Freeze_document": "Freeze document",
|
|
431
431
|
"Unfreeze": "Unfreeze",
|
|
432
432
|
"Search_and_replace": "Search and replace",
|
|
433
433
|
"Search": "Suchen",
|
|
@@ -427,7 +427,7 @@
|
|
|
427
427
|
"Other_modification": "Other's modification",
|
|
428
428
|
"My_modification": "My modification",
|
|
429
429
|
"Document_history": "Document history",
|
|
430
|
-
"
|
|
430
|
+
"Freeze_document": "Freeze document",
|
|
431
431
|
"Unfreeze": "Unfreeze",
|
|
432
432
|
"Search_and_replace": "Search and replace",
|
|
433
433
|
"Search": "Search",
|
|
@@ -427,7 +427,7 @@
|
|
|
427
427
|
"Other_modification": "Other's modification",
|
|
428
428
|
"My_modification": "My modification",
|
|
429
429
|
"Document_history": "Document history",
|
|
430
|
-
"
|
|
430
|
+
"Freeze_document": "Freeze document",
|
|
431
431
|
"Unfreeze": "Unfreeze",
|
|
432
432
|
"Search_and_replace": "Search and replace",
|
|
433
433
|
"Search": "Buscar",
|
|
@@ -427,7 +427,7 @@
|
|
|
427
427
|
"Other_modification": "Other's modification",
|
|
428
428
|
"My_modification": "My modification",
|
|
429
429
|
"Document_history": "Document history",
|
|
430
|
-
"
|
|
430
|
+
"Freeze_document": "Freeze document",
|
|
431
431
|
"Unfreeze": "Unfreeze",
|
|
432
432
|
"Search_and_replace": "Search and replace",
|
|
433
433
|
"Search": "Chercher",
|
|
@@ -427,7 +427,7 @@
|
|
|
427
427
|
"Other_modification": "Other's modification",
|
|
428
428
|
"My_modification": "My modification",
|
|
429
429
|
"Document_history": "Document history",
|
|
430
|
-
"
|
|
430
|
+
"Freeze_document": "Freeze document",
|
|
431
431
|
"Unfreeze": "Unfreeze",
|
|
432
432
|
"Search_and_replace": "Search and replace",
|
|
433
433
|
"Search": "Search",
|
|
@@ -427,18 +427,18 @@
|
|
|
427
427
|
"Other_modification": "Другая модификация",
|
|
428
428
|
"My_modification": "Моя модификация",
|
|
429
429
|
"Document_history": "История документа",
|
|
430
|
-
"
|
|
430
|
+
"Freeze_document": "Заморозить документ",
|
|
431
431
|
"Unfreeze": "Разморозить",
|
|
432
|
-
"Search_and_replace": "
|
|
432
|
+
"Search_and_replace": "Поиск и замена",
|
|
433
433
|
"Search": "Поиск",
|
|
434
|
-
"Type_search_content": "
|
|
435
|
-
"Replace_as": "
|
|
436
|
-
"Type_replace_content": "
|
|
434
|
+
"Type_search_content": "Введите содержимое для поиска",
|
|
435
|
+
"Replace_as": "Заменить как",
|
|
436
|
+
"Type_replace_content": "Введите содержимое для замены",
|
|
437
437
|
"Previous": "Предыдущий",
|
|
438
438
|
"Next": "Следующий",
|
|
439
439
|
"Replace": "Заменить",
|
|
440
|
-
"Replace_all": "
|
|
441
|
-
"Are_you_sure_to_replace_all_number_xxx_in_this_document_with_yyy": "
|
|
442
|
-
"Are_you_sure_to_clear_all_number_xxx_in_this_document": "
|
|
443
|
-
"Search_not_found": "
|
|
440
|
+
"Replace_all": "Заменить все",
|
|
441
|
+
"Are_you_sure_to_replace_all_number_xxx_in_this_document_with_yyy": "Вы уверены, что хотите заменить все {{number}} '{{originalWord}}' в этом документе на '{{replacedWord}}'?",
|
|
442
|
+
"Are_you_sure_to_clear_all_number_xxx_in_this_document": "Вы уверены, что хотите очистить все {{number}} '{{originalWord}}' в этом документе?",
|
|
443
|
+
"Search_not_found": "Не найдено"
|
|
444
444
|
}
|