@seafile/sdoc-editor 1.0.7 → 1.0.8
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/plugin.js +6 -3
- package/dist/basic-sdk/extension/plugins/callout/render-elem/callout-hover-menu/index.js +14 -1
- package/dist/basic-sdk/extension/plugins/callout/render-elem/callout-hover-menu/style.css +4 -2
- package/dist/basic-sdk/extension/plugins/link/plugin.js +14 -21
- package/dist/basic-sdk/extension/plugins/table/menu/color-selector-popover/index.js +1 -1
- package/dist/basic-sdk/extension/plugins/table/menu/table-context-menu/index.js +3 -3
- package/dist/basic-sdk/extension/plugins/table/menu/vertical-align-popover/index.js +1 -1
- package/package.json +1 -1
- package/public/locales/cs/sdoc-editor.json +2 -1
- package/public/locales/de/sdoc-editor.json +2 -1
- package/public/locales/en/sdoc-editor.json +2 -1
- package/public/locales/es/sdoc-editor.json +2 -1
- package/public/locales/es_AR/sdoc-editor.json +2 -1
- package/public/locales/es_MX/sdoc-editor.json +2 -1
- package/public/locales/fr/sdoc-editor.json +2 -1
- package/public/locales/it/sdoc-editor.json +2 -1
- package/public/locales/ru/sdoc-editor.json +2 -1
- package/public/locales/zh_CN/sdoc-editor.json +2 -1
|
@@ -112,10 +112,13 @@ const withBlockquote = editor => {
|
|
|
112
112
|
const parentNodeEntry = Editor.parent(editor, paragraphEntry[1]);
|
|
113
113
|
if (parentNodeEntry && parentNodeEntry[0].type === BLOCKQUOTE) {
|
|
114
114
|
if (!Node.string(paragraphEntry[0]).length) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
data.forEach(node => {
|
|
116
|
+
if (node.type === BLOCKQUOTE) {
|
|
117
|
+
node.type = PARAGRAPH;
|
|
118
|
+
}
|
|
118
119
|
});
|
|
120
|
+
insertFragment(data);
|
|
121
|
+
return;
|
|
119
122
|
}
|
|
120
123
|
}
|
|
121
124
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React, { useCallback, useState } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
3
4
|
import { ElementPopover } from '../../../../commons';
|
|
4
5
|
import ColorSelector from '../callout-color-selector';
|
|
5
6
|
import IconSelector from '../callout-icon';
|
|
7
|
+
import { setCalloutIcon } from '../../helper';
|
|
6
8
|
import './style.css';
|
|
7
9
|
export default function CalloutHoverMenu(_ref) {
|
|
8
10
|
let {
|
|
@@ -12,6 +14,9 @@ export default function CalloutHoverMenu(_ref) {
|
|
|
12
14
|
} = _ref;
|
|
13
15
|
const [isShowColorSelector, setIsShowColorSelector] = useState(false);
|
|
14
16
|
const [isShowIcon, setIsShowIcon] = useState(false);
|
|
17
|
+
const {
|
|
18
|
+
t
|
|
19
|
+
} = useTranslation();
|
|
15
20
|
const onColorSelectorToggle = useCallback(event => {
|
|
16
21
|
event.stopPropagation();
|
|
17
22
|
if (!isShowColorSelector) {
|
|
@@ -38,6 +43,9 @@ export default function CalloutHoverMenu(_ref) {
|
|
|
38
43
|
'callout-menu-item': true,
|
|
39
44
|
'icon-active': isShowIcon
|
|
40
45
|
});
|
|
46
|
+
const handleRemoveIcon = () => {
|
|
47
|
+
setCalloutIcon(editor, '');
|
|
48
|
+
};
|
|
41
49
|
return /*#__PURE__*/React.createElement(ElementPopover, null, /*#__PURE__*/React.createElement("div", {
|
|
42
50
|
className: "sdoc-callout-hover-menu",
|
|
43
51
|
style: popoverPosition
|
|
@@ -65,5 +73,10 @@ export default function CalloutHoverMenu(_ref) {
|
|
|
65
73
|
editor: editor,
|
|
66
74
|
element: element,
|
|
67
75
|
onCloseSelector: onCloseSelector
|
|
68
|
-
})
|
|
76
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
77
|
+
className: "callout-menu-divider"
|
|
78
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
className: "callout-menu-item",
|
|
80
|
+
onClick: handleRemoveIcon
|
|
81
|
+
}, t('Remove_icon'))));
|
|
69
82
|
}
|
|
@@ -14,12 +14,14 @@
|
|
|
14
14
|
display: flex;
|
|
15
15
|
justify-content: center;
|
|
16
16
|
align-items: center;
|
|
17
|
-
|
|
17
|
+
font-size: 12px;
|
|
18
|
+
color: #212529;
|
|
18
19
|
cursor: pointer;
|
|
20
|
+
border-radius: 3px;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
.sdoc-callout-hover-menu .callout-menu-item:hover {
|
|
22
|
-
color: #
|
|
24
|
+
background-color: #f2f2f2;
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
.sdoc-callout-hover-menu .callout-menu-item .sdocfont {
|
|
@@ -29,33 +29,26 @@ const withLink = editor => {
|
|
|
29
29
|
}
|
|
30
30
|
return isInline(elem);
|
|
31
31
|
};
|
|
32
|
-
newEditor.insertData = data => {
|
|
32
|
+
newEditor.insertData = async data => {
|
|
33
33
|
// Paste link content
|
|
34
34
|
const text = data.getData('text/plain');
|
|
35
|
+
// Internal link, insert sdoc file link
|
|
35
36
|
if (isUrl(text) && !isImage(text)) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
if (isSameDomain(text, context.getSetting('serviceUrl'))) {
|
|
38
|
+
const res = await context.getLinkFilesInfo([text]);
|
|
39
|
+
if (isSdocFile(res, text)) {
|
|
40
|
+
const fileName = res.data.files_info[text].name;
|
|
41
|
+
const fileUuid = res.data.files_info[text].file_uuid;
|
|
42
|
+
insertSdocFileLink(editor, fileName, fileUuid);
|
|
43
|
+
}
|
|
44
|
+
} else {
|
|
45
|
+
const link = genLinkNode(text, text);
|
|
46
|
+
Transforms.insertNodes(newEditor, link);
|
|
47
|
+
}
|
|
48
|
+
// Void merging text from link
|
|
39
49
|
const [, focusPath] = Editor.next(newEditor);
|
|
40
50
|
const focusPoint = Editor.start(newEditor, focusPath);
|
|
41
51
|
Transforms.select(newEditor, focusPoint);
|
|
42
|
-
if (isSameDomain(text, context.getSetting('serviceUrl'))) {
|
|
43
|
-
context.getLinkFilesInfo([text]).then(res => {
|
|
44
|
-
if (isSdocFile(res, text)) {
|
|
45
|
-
const [nodeEntry] = Editor.nodes(editor, {
|
|
46
|
-
match: n => n.type === LINK,
|
|
47
|
-
universal: true
|
|
48
|
-
});
|
|
49
|
-
const fileName = res.data.files_info[text].name;
|
|
50
|
-
const fileUuid = res.data.files_info[text].file_uuid;
|
|
51
|
-
Transforms.removeNodes(editor, {
|
|
52
|
-
at: nodeEntry[1]
|
|
53
|
-
});
|
|
54
|
-
insertSdocFileLink(editor, fileName, fileUuid);
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
52
|
return;
|
|
60
53
|
}
|
|
61
54
|
insertData(data);
|
|
@@ -87,7 +87,7 @@ const ColorSelectorPopover = _ref => {
|
|
|
87
87
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
88
88
|
}, [readonly]);
|
|
89
89
|
return /*#__PURE__*/React.createElement(UncontrolledPopover, {
|
|
90
|
-
target: target,
|
|
90
|
+
target: target.current,
|
|
91
91
|
trigger: "hover",
|
|
92
92
|
placement: "right-start",
|
|
93
93
|
hideArrow: true,
|
|
@@ -190,7 +190,7 @@ class TableContextMenu extends React.Component {
|
|
|
190
190
|
onClick: e => console.log('123')
|
|
191
191
|
}, /*#__PURE__*/React.createElement("span", null, t('Horizontal_align')), /*#__PURE__*/React.createElement("i", {
|
|
192
192
|
className: "sdocfont sdoc-right-slide"
|
|
193
|
-
})), /*#__PURE__*/React.createElement(HorizontalAlignPopover, {
|
|
193
|
+
})), this.horizontalAlignRef.current && /*#__PURE__*/React.createElement(HorizontalAlignPopover, {
|
|
194
194
|
target: this.horizontalAlignRef,
|
|
195
195
|
editor: editor,
|
|
196
196
|
readonly: readonly,
|
|
@@ -200,7 +200,7 @@ class TableContextMenu extends React.Component {
|
|
|
200
200
|
className: "dropdown-item side-extendable"
|
|
201
201
|
}, /*#__PURE__*/React.createElement("span", null, t('Vertical_align')), /*#__PURE__*/React.createElement("i", {
|
|
202
202
|
className: "sdocfont sdoc-right-slide"
|
|
203
|
-
})), /*#__PURE__*/React.createElement(VerticalAlignPopover, {
|
|
203
|
+
})), this.verticalAlignRef.current && /*#__PURE__*/React.createElement(VerticalAlignPopover, {
|
|
204
204
|
target: this.verticalAlignRef,
|
|
205
205
|
editor: editor,
|
|
206
206
|
readonly: readonly,
|
|
@@ -210,7 +210,7 @@ class TableContextMenu extends React.Component {
|
|
|
210
210
|
className: "dropdown-item side-extendable"
|
|
211
211
|
}, /*#__PURE__*/React.createElement("span", null, t('Background_color')), /*#__PURE__*/React.createElement("i", {
|
|
212
212
|
className: "sdocfont sdoc-right-slide"
|
|
213
|
-
})), /*#__PURE__*/React.createElement(ColorSelectorPopover, {
|
|
213
|
+
})), this.colorSelectorRef.current && /*#__PURE__*/React.createElement(ColorSelectorPopover, {
|
|
214
214
|
target: this.colorSelectorRef,
|
|
215
215
|
editor: editor,
|
|
216
216
|
readonly: readonly
|
package/package.json
CHANGED
|
@@ -468,5 +468,6 @@
|
|
|
468
468
|
"Show_record_numbers": "Show record numbers",
|
|
469
469
|
"Alternate_color": "Alternate color",
|
|
470
470
|
"Select_column_display_option_color_tip": "Single-select and multi-select columns display option colors",
|
|
471
|
-
"Header": "Header"
|
|
471
|
+
"Header": "Header",
|
|
472
|
+
"Remove_icon": "Remove icon"
|
|
472
473
|
}
|
|
@@ -468,5 +468,6 @@
|
|
|
468
468
|
"Show_record_numbers": "Show record numbers",
|
|
469
469
|
"Alternate_color": "Alternate color",
|
|
470
470
|
"Select_column_display_option_color_tip": "Single-select and multi-select columns display option colors",
|
|
471
|
-
"Header": "Überschrift"
|
|
471
|
+
"Header": "Überschrift",
|
|
472
|
+
"Remove_icon": "Remove icon"
|
|
472
473
|
}
|
|
@@ -468,5 +468,6 @@
|
|
|
468
468
|
"Show_record_numbers": "Show record numbers",
|
|
469
469
|
"Alternate_color": "Alternate color",
|
|
470
470
|
"Select_column_display_option_color_tip": "Single-select and multi-select columns display option colors",
|
|
471
|
-
"Header": "Header"
|
|
471
|
+
"Header": "Header",
|
|
472
|
+
"Remove_icon": "Remove icon"
|
|
472
473
|
}
|
|
@@ -468,5 +468,6 @@
|
|
|
468
468
|
"Show_record_numbers": "Show record numbers",
|
|
469
469
|
"Alternate_color": "Alternate color",
|
|
470
470
|
"Select_column_display_option_color_tip": "Single-select and multi-select columns display option colors",
|
|
471
|
-
"Header": "Encabezado"
|
|
471
|
+
"Header": "Encabezado",
|
|
472
|
+
"Remove_icon": "Remove icon"
|
|
472
473
|
}
|
|
@@ -468,5 +468,6 @@
|
|
|
468
468
|
"Show_record_numbers": "Show record numbers",
|
|
469
469
|
"Alternate_color": "Alternate color",
|
|
470
470
|
"Select_column_display_option_color_tip": "Single-select and multi-select columns display option colors",
|
|
471
|
-
"Header": "Encabezado"
|
|
471
|
+
"Header": "Encabezado",
|
|
472
|
+
"Remove_icon": "Remove icon"
|
|
472
473
|
}
|
|
@@ -468,5 +468,6 @@
|
|
|
468
468
|
"Show_record_numbers": "Show record numbers",
|
|
469
469
|
"Alternate_color": "Alternate color",
|
|
470
470
|
"Select_column_display_option_color_tip": "Single-select and multi-select columns display option colors",
|
|
471
|
-
"Header": "Encabezado"
|
|
471
|
+
"Header": "Encabezado",
|
|
472
|
+
"Remove_icon": "Remove icon"
|
|
472
473
|
}
|
|
@@ -468,5 +468,6 @@
|
|
|
468
468
|
"Show_record_numbers": "Show record numbers",
|
|
469
469
|
"Alternate_color": "Alternate color",
|
|
470
470
|
"Select_column_display_option_color_tip": "Single-select and multi-select columns display option colors",
|
|
471
|
-
"Header": "En-tête "
|
|
471
|
+
"Header": "En-tête ",
|
|
472
|
+
"Remove_icon": "Remove icon"
|
|
472
473
|
}
|
|
@@ -468,5 +468,6 @@
|
|
|
468
468
|
"Show_record_numbers": "Show record numbers",
|
|
469
469
|
"Alternate_color": "Alternate color",
|
|
470
470
|
"Select_column_display_option_color_tip": "Single-select and multi-select columns display option colors",
|
|
471
|
-
"Header": "Intestazione"
|
|
471
|
+
"Header": "Intestazione",
|
|
472
|
+
"Remove_icon": "Remove icon"
|
|
472
473
|
}
|
|
@@ -468,5 +468,6 @@
|
|
|
468
468
|
"Show_record_numbers": "Показывать номера записей",
|
|
469
469
|
"Alternate_color": "Альтернативный цвет",
|
|
470
470
|
"Select_column_display_option_color_tip": "Цвета параметров отображения столбцов с одиночным и множественным выбором",
|
|
471
|
-
"Header": "Заголовок"
|
|
471
|
+
"Header": "Заголовок",
|
|
472
|
+
"Remove_icon": "Remove icon"
|
|
472
473
|
}
|