@seafile/sdoc-editor 1.0.4 → 1.0.6
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/constants/menus-config.js +5 -0
- package/dist/basic-sdk/extension/plugins/blockquote/helpers.js +6 -2
- package/dist/basic-sdk/extension/plugins/blockquote/menu/index.js +2 -4
- package/dist/basic-sdk/extension/plugins/seatable-tables/op-menu/index.js +17 -4
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/custom-switch/index.css +28 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/custom-switch/index.js +18 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/index.js +8 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/hide-column-setter/index.js +8 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/index.css +66 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/index.js +73 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/sort-setter/index.js +8 -0
- package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/table-setting/index.js +40 -0
- package/dist/basic-sdk/extension/toolbar/insert-element-toolbar/index.js +12 -2
- package/dist/basic-sdk/extension/toolbar/side-toolbar/index.js +12 -2
- package/package.json +1 -1
- package/public/locales/cs/sdoc-editor.json +4 -1
- package/public/locales/de/sdoc-editor.json +4 -1
- package/public/locales/en/sdoc-editor.json +4 -1
- package/public/locales/es/sdoc-editor.json +4 -1
- package/public/locales/es_AR/sdoc-editor.json +4 -1
- package/public/locales/es_MX/sdoc-editor.json +4 -1
- package/public/locales/fr/sdoc-editor.json +4 -1
- package/public/locales/it/sdoc-editor.json +4 -1
- package/public/locales/ru/sdoc-editor.json +5 -2
- package/public/locales/zh_CN/sdoc-editor.json +4 -1
|
@@ -2,7 +2,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
2
2
|
import { Editor, Transforms, Element, Node } 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 { getNodeType } from '../../core';
|
|
5
|
+
import { focusEditor, getNodeType } from '../../core';
|
|
6
6
|
export const isMenuDisabled = (editor, readonly) => {
|
|
7
7
|
if (readonly) return true;
|
|
8
8
|
if (editor.selection == null) return true;
|
|
@@ -41,7 +41,7 @@ export const getBlockQuoteType = editor => {
|
|
|
41
41
|
return getNodeType(n);
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
// If cursor is in
|
|
44
|
+
// If cursor is in callout, insert block quote in callout, otherwise wrap block quote directly
|
|
45
45
|
export const setBlockQuoteType = (editor, active) => {
|
|
46
46
|
if (!active) {
|
|
47
47
|
const blockquoteNode = {
|
|
@@ -108,4 +108,8 @@ export const getFormattedRestElements = data => {
|
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
return restElements;
|
|
111
|
+
};
|
|
112
|
+
export const insertBlockQuote = (editor, active) => {
|
|
113
|
+
setBlockQuoteType(editor, active);
|
|
114
|
+
focusEditor(editor);
|
|
111
115
|
};
|
|
@@ -3,8 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { BLOCKQUOTE, MENUS_CONFIG_MAP } from '../../../constants';
|
|
5
5
|
import { MenuItem } from '../../../commons';
|
|
6
|
-
import { getBlockQuoteType,
|
|
7
|
-
import { focusEditor } from '../../../core';
|
|
6
|
+
import { getBlockQuoteType, insertBlockQuote, isMenuDisabled } from '../helpers';
|
|
8
7
|
class QuoteMenu extends React.Component {
|
|
9
8
|
constructor() {
|
|
10
9
|
super(...arguments);
|
|
@@ -26,8 +25,7 @@ class QuoteMenu extends React.Component {
|
|
|
26
25
|
editor
|
|
27
26
|
} = this.props;
|
|
28
27
|
const active = this.isActive(editor);
|
|
29
|
-
|
|
30
|
-
focusEditor(editor);
|
|
28
|
+
insertBlockQuote(editor, active);
|
|
31
29
|
});
|
|
32
30
|
}
|
|
33
31
|
render() {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useCallback, useState } from 'react';
|
|
2
2
|
import { ElementPopover } from '../../../commons';
|
|
3
|
+
import TableSettings from '../seatable-settings';
|
|
3
4
|
import './index.css';
|
|
4
5
|
export default function OpMenu(_ref) {
|
|
5
6
|
let {
|
|
@@ -7,11 +8,23 @@ export default function OpMenu(_ref) {
|
|
|
7
8
|
element,
|
|
8
9
|
menuPosition
|
|
9
10
|
} = _ref;
|
|
10
|
-
const [
|
|
11
|
+
const [isShowSeaTableSetting, setIsShowSeaTableSetting] = useState(false);
|
|
12
|
+
const onShowSettings = useCallback(() => {
|
|
13
|
+
setIsShowSeaTableSetting(true);
|
|
14
|
+
}, []);
|
|
15
|
+
const onHideSettings = useCallback(() => {
|
|
16
|
+
setIsShowSeaTableSetting(false);
|
|
17
|
+
}, []);
|
|
18
|
+
console.log(isShowSeaTableSetting);
|
|
11
19
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ElementPopover, null, /*#__PURE__*/React.createElement("div", {
|
|
12
20
|
className: "seatable-op-menu",
|
|
13
21
|
style: menuPosition
|
|
14
22
|
}, /*#__PURE__*/React.createElement("span", {
|
|
15
|
-
className: "sdocfont sdoc-settings"
|
|
16
|
-
|
|
23
|
+
className: "sdocfont sdoc-settings",
|
|
24
|
+
onClick: onShowSettings
|
|
25
|
+
}))), isShowSeaTableSetting && /*#__PURE__*/React.createElement(TableSettings, {
|
|
26
|
+
editor: editor,
|
|
27
|
+
element: element,
|
|
28
|
+
onHideSettings: onHideSettings
|
|
29
|
+
}));
|
|
17
30
|
}
|
package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/custom-switch/index.css
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.document-plugin .widget-table-switch-properties .custom-switch-description {
|
|
2
|
+
margin-left: 0;
|
|
3
|
+
white-space: normal;
|
|
4
|
+
flex: 1;
|
|
5
|
+
margin-right: .5rem;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.document-plugin .widget-table-switch-properties .custom-switch {
|
|
9
|
+
width: 100%;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
padding-left: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.document-plugin .widget-table-switch-properties .custom-switch-indicator {
|
|
16
|
+
width: 22px;
|
|
17
|
+
height: 12px;
|
|
18
|
+
flex-shrink: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.document-plugin .widget-table-switch-properties .custom-switch-indicator:before {
|
|
22
|
+
height: 8px;
|
|
23
|
+
width: 8px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.document-plugin .widget-table-switch-properties .custom-switch-input:checked~.custom-switch-indicator:before {
|
|
27
|
+
left: 12px;
|
|
28
|
+
}
|
package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/custom-switch/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DTableSwitch } from 'dtable-ui-component';
|
|
3
|
+
import './index.css';
|
|
4
|
+
function CustomSwitch(props) {
|
|
5
|
+
const {
|
|
6
|
+
isLocked,
|
|
7
|
+
checked,
|
|
8
|
+
title
|
|
9
|
+
} = props;
|
|
10
|
+
return /*#__PURE__*/React.createElement(DTableSwitch, {
|
|
11
|
+
checked: checked,
|
|
12
|
+
disabled: isLocked,
|
|
13
|
+
switchClassName: "widget-table-switch-properties w-100",
|
|
14
|
+
placeholder: title,
|
|
15
|
+
onChange: () => props.onPropertiesChanged(!checked)
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export default CustomSwitch;
|
package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/filter-setter/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export default function FilterSetter() {
|
|
3
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
4
|
+
className: "setting-item-btn filters-setting"
|
|
5
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
6
|
+
className: "dtable-font dtable-icon-filter mr-2"
|
|
7
|
+
}), /*#__PURE__*/React.createElement("div", null, "FilterSetter"));
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export default function HideColumnSetter() {
|
|
3
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
4
|
+
className: "setting-item-btn columns-setting"
|
|
5
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
6
|
+
className: "dtable-font dtable-icon-hide mr-2"
|
|
7
|
+
}), /*#__PURE__*/React.createElement("div", null, "Hide column setter"));
|
|
8
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
.document-seatable-settings-wrapper {
|
|
2
|
+
position: fixed;
|
|
3
|
+
right: 0;
|
|
4
|
+
top: 200px;
|
|
5
|
+
width: 300px;
|
|
6
|
+
bottom: 0;
|
|
7
|
+
background-color: #fff;
|
|
8
|
+
border-left: 1px solid #e4e4e4;
|
|
9
|
+
transition: width .25s ease-in-out 0s;
|
|
10
|
+
z-index: 4;
|
|
11
|
+
display: flex;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.document-seatable-settings-container {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex: 1 1;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
min-height: 0;
|
|
19
|
+
min-width: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.document-seatable-settings-container .document-seatable-settings-header {
|
|
23
|
+
height: 48px;
|
|
24
|
+
line-height: 48px;
|
|
25
|
+
padding: 0 16px;
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
border-bottom: 1px solid #e4e4e4;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.document-seatable-settings-container .document-seatable-settings-content {
|
|
32
|
+
height: calc(100% - 49px);
|
|
33
|
+
overflow: auto;
|
|
34
|
+
width: 100%;
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
padding: 16px 16px 50px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.document-plugin .document-seatable-settings-container .setting-item {
|
|
41
|
+
margin: 0;
|
|
42
|
+
margin-bottom: 1rem;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.document-plugin .document-seatable-settings-container .setting-divide-line {
|
|
46
|
+
border-bottom: 1px solid #e2e2e2;
|
|
47
|
+
margin: 14px 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.document-plugin .document-seatable-settings-container .setting-item.table-setting {
|
|
51
|
+
margin-bottom: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.document-plugin .document-seatable-settings-container .setting-item-btn {
|
|
55
|
+
display: flex;
|
|
56
|
+
border-radius: 4px;
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
line-height: 22px;
|
|
59
|
+
padding: 3px 4px;
|
|
60
|
+
width: 100%;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.document-plugin .document-seatable-settings-container .setting-item-btn .dtable-font {
|
|
64
|
+
color: #666;
|
|
65
|
+
font-size: 14px;
|
|
66
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React, { useCallback, useState } from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import CustomSwitch from './custom-switch';
|
|
4
|
+
import './index.css';
|
|
5
|
+
import TableSetting from './table-setting';
|
|
6
|
+
import FilterSetter from './filter-setter';
|
|
7
|
+
import SortSetter from './sort-setter';
|
|
8
|
+
import HideColumnSetter from './hide-column-setter';
|
|
9
|
+
export default function TableSettings(_ref) {
|
|
10
|
+
let {
|
|
11
|
+
editor,
|
|
12
|
+
element,
|
|
13
|
+
onHideSettings
|
|
14
|
+
} = _ref;
|
|
15
|
+
const [settings, updateSettings] = useState(element);
|
|
16
|
+
const {
|
|
17
|
+
t
|
|
18
|
+
} = useTranslation();
|
|
19
|
+
const onTableChange = useCallback(option => {
|
|
20
|
+
console.log(option);
|
|
21
|
+
}, []);
|
|
22
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
23
|
+
className: "document-seatable-settings-wrapper"
|
|
24
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
className: "document-seatable-settings-container"
|
|
26
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
className: "document-seatable-settings-header"
|
|
28
|
+
}, /*#__PURE__*/React.createElement("span", null, t('SeaTable_settings')), /*#__PURE__*/React.createElement("span", {
|
|
29
|
+
className: "dtable-font dtable-icon-x",
|
|
30
|
+
onClick: onHideSettings
|
|
31
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
32
|
+
className: "document-seatable-settings-content"
|
|
33
|
+
}, /*#__PURE__*/React.createElement(TableSetting, {
|
|
34
|
+
tables: editor.tables,
|
|
35
|
+
element: settings,
|
|
36
|
+
onTableChange: onTableChange
|
|
37
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
38
|
+
class: "setting-divide-line"
|
|
39
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
className: "setting-item"
|
|
41
|
+
}, "Data settings"), /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: "setting-item filter-setter"
|
|
43
|
+
}, /*#__PURE__*/React.createElement(FilterSetter, null)), /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: "setting-item sort-setter"
|
|
45
|
+
}, /*#__PURE__*/React.createElement(SortSetter, null)), /*#__PURE__*/React.createElement("div", {
|
|
46
|
+
className: "setting-item hide-column-setter"
|
|
47
|
+
}, /*#__PURE__*/React.createElement(HideColumnSetter, null)), /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
class: "setting-divide-line"
|
|
49
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
className: "setting-item"
|
|
51
|
+
}, "Style Settings"), /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
className: "setting-item"
|
|
53
|
+
}, /*#__PURE__*/React.createElement(CustomSwitch, {
|
|
54
|
+
checked: settings['show_record_numbers'],
|
|
55
|
+
isLocked: false,
|
|
56
|
+
title: t('Show_record_numbers'),
|
|
57
|
+
onPropertiesChanged: value => this.onSwitchPropertiesChanged('showRowNumber', value)
|
|
58
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
className: "setting-item"
|
|
60
|
+
}, /*#__PURE__*/React.createElement(CustomSwitch, {
|
|
61
|
+
checked: settings['alternate_color'],
|
|
62
|
+
isLocked: false,
|
|
63
|
+
title: t('Alternate_color'),
|
|
64
|
+
onPropertiesChanged: value => this.onSwitchPropertiesChanged('applyBandedTableDesign', value)
|
|
65
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
66
|
+
className: "setting-item"
|
|
67
|
+
}, /*#__PURE__*/React.createElement(CustomSwitch, {
|
|
68
|
+
checked: settings['select_column_display_option_color'] === false ? false : true,
|
|
69
|
+
isLocked: false,
|
|
70
|
+
title: t('Select_column_display_option_color_tip'),
|
|
71
|
+
onPropertiesChanged: value => this.onSwitchPropertiesChanged('select_column_display_option_color', value)
|
|
72
|
+
})))));
|
|
73
|
+
}
|
package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/sort-setter/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export default function SortSetter() {
|
|
3
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
4
|
+
className: "setting-item-btn sorts-setting"
|
|
5
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
6
|
+
className: "dtable-font dtable-icon-sort mr-2"
|
|
7
|
+
}), /*#__PURE__*/React.createElement("div", null, "Sort setter"));
|
|
8
|
+
}
|
package/dist/basic-sdk/extension/plugins/seatable-tables/seatable-settings/table-setting/index.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { withTranslation } from 'react-i18next';
|
|
3
|
+
import { Label } from 'reactstrap';
|
|
4
|
+
import { DTableSelect } from 'dtable-ui-component';
|
|
5
|
+
class TableSetting extends React.Component {
|
|
6
|
+
render() {
|
|
7
|
+
const {
|
|
8
|
+
tables,
|
|
9
|
+
element,
|
|
10
|
+
t
|
|
11
|
+
} = this.props;
|
|
12
|
+
const {
|
|
13
|
+
table_id
|
|
14
|
+
} = element;
|
|
15
|
+
const options = tables.map(item => {
|
|
16
|
+
let value = item._id;
|
|
17
|
+
let label = item.name;
|
|
18
|
+
return {
|
|
19
|
+
value,
|
|
20
|
+
label
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
let selectedOption;
|
|
24
|
+
if (table_id) {
|
|
25
|
+
selectedOption = options.find(option => option.value === table_id);
|
|
26
|
+
}
|
|
27
|
+
if (!selectedOption) {
|
|
28
|
+
selectedOption = options[0];
|
|
29
|
+
}
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: "setting-item table-setting"
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Label, null, t('Table')), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
33
|
+
value: selectedOption,
|
|
34
|
+
options: options,
|
|
35
|
+
onChange: this.props.onTableChange,
|
|
36
|
+
menuPortalTarget: "element-settings"
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export default withTranslation('sdoc-editor')(TableSetting);
|
|
@@ -8,7 +8,7 @@ import TableSizePopover from '../../plugins/table/popover/table-size-popover';
|
|
|
8
8
|
import { changeToCodeBlock } from '../../plugins/code-block/helpers';
|
|
9
9
|
import { toggleList } from '../../plugins/list/transforms';
|
|
10
10
|
import { setCheckListItemType } from '../../plugins/check-list/helpers';
|
|
11
|
-
import { ELEMENT_TYPE, IMAGE, INSERT_POSITION, LINK, LOCAL_IMAGE, PARAGRAPH, SIDE_INSERT_MENUS_CONFIG, TABLE, CODE_BLOCK, CALL_OUT, UNORDERED_LIST, ORDERED_LIST, CHECK_LIST_ITEM, QUICK_INSERT } from '../../constants';
|
|
11
|
+
import { ELEMENT_TYPE, IMAGE, INSERT_POSITION, LINK, LOCAL_IMAGE, PARAGRAPH, SIDE_INSERT_MENUS_CONFIG, TABLE, CODE_BLOCK, CALL_OUT, UNORDERED_LIST, ORDERED_LIST, CHECK_LIST_ITEM, QUICK_INSERT, BLOCKQUOTE } from '../../constants';
|
|
12
12
|
import EventBus from '../../../utils/event-bus';
|
|
13
13
|
import { INTERNAL_EVENT } from '../../../constants';
|
|
14
14
|
import DropdownMenuItem from '../../commons/dropdown-menu-item';
|
|
@@ -16,6 +16,7 @@ import { wrapCallout } from '../../plugins/callout/helper';
|
|
|
16
16
|
import keyCodes from '../../../../constants/key-codes';
|
|
17
17
|
import { SELECTED_ITEM_CLASS_NAME, SHORT_INSERT_ELEMENT_USER_INPUT_MAP } from './const';
|
|
18
18
|
import { getAboveBlockNode } from '../../core';
|
|
19
|
+
import { insertBlockQuote } from '../../plugins/blockquote/helpers';
|
|
19
20
|
import './style.css';
|
|
20
21
|
const QuickInsertBlockMenu = _ref => {
|
|
21
22
|
let {
|
|
@@ -97,6 +98,10 @@ const QuickInsertBlockMenu = _ref => {
|
|
|
97
98
|
});
|
|
98
99
|
return !!callout;
|
|
99
100
|
}, [editor]);
|
|
101
|
+
const onInsertBlockQuote = useCallback(() => {
|
|
102
|
+
callback && callback();
|
|
103
|
+
insertBlockQuote(editor, false);
|
|
104
|
+
}, [callback, editor]);
|
|
100
105
|
const dropDownItems = useMemo(() => {
|
|
101
106
|
let items = {
|
|
102
107
|
[IMAGE]: /*#__PURE__*/React.createElement(DropdownMenuItem, {
|
|
@@ -126,6 +131,11 @@ const QuickInsertBlockMenu = _ref => {
|
|
|
126
131
|
menuConfig: _objectSpread({}, SIDE_INSERT_MENUS_CONFIG[ELEMENT_TYPE.LINK]),
|
|
127
132
|
onClick: openLinkDialog
|
|
128
133
|
}),
|
|
134
|
+
[BLOCKQUOTE]: /*#__PURE__*/React.createElement(DropdownMenuItem, {
|
|
135
|
+
key: "sdoc-insert-menu-blockquote",
|
|
136
|
+
menuConfig: _objectSpread({}, SIDE_INSERT_MENUS_CONFIG[ELEMENT_TYPE.BLOCKQUOTE]),
|
|
137
|
+
onClick: onInsertBlockQuote
|
|
138
|
+
}),
|
|
129
139
|
[CODE_BLOCK]: /*#__PURE__*/React.createElement(DropdownMenuItem, {
|
|
130
140
|
key: "sdoc-insert-menu-code-block",
|
|
131
141
|
menuConfig: _objectSpread({}, SIDE_INSERT_MENUS_CONFIG[ELEMENT_TYPE.CODE_BLOCK]),
|
|
@@ -171,7 +181,7 @@ const QuickInsertBlockMenu = _ref => {
|
|
|
171
181
|
});
|
|
172
182
|
});
|
|
173
183
|
return items;
|
|
174
|
-
}, [createTable, editor, isDisableCallout, isEmptyNode, onInsert, onInsertCallout, onInsertCheckList, onInsertCodeBlock, onInsertImageToggle, onInsertList, openLinkDialog]);
|
|
184
|
+
}, [createTable, editor, isDisableCallout, isEmptyNode, onInsert, onInsertBlockQuote, onInsertCallout, onInsertCheckList, onInsertCodeBlock, onInsertImageToggle, onInsertList, openLinkDialog]);
|
|
175
185
|
const getSelectItemDom = selectIndex => {
|
|
176
186
|
const dropDownItemWrapper = downDownWrapperRef.current;
|
|
177
187
|
const currentSelectItem = dropDownItemWrapper.children[selectIndex];
|
|
@@ -8,7 +8,7 @@ import { useScrollContext } from '../../../hooks/use-scroll-context';
|
|
|
8
8
|
import { focusEditor } from '../../core';
|
|
9
9
|
import { getDomTopHeight, setSelection, isVoidNode, getNodeEntry, isBlockquote, isList, onWrapListItem } from './helpers';
|
|
10
10
|
import { insertImageFiles } from '../../plugins/image/helpers';
|
|
11
|
-
import { INTERNAL_EVENT } from '../../../constants';
|
|
11
|
+
import { INTERNAL_EVENT, WIKI_EDITOR } from '../../../constants';
|
|
12
12
|
import { CODE_BLOCK, TABLE, BLOCKQUOTE, CHECK_LIST_ITEM, CALL_OUT, TABLE_DRAG_KEY } from '../../constants';
|
|
13
13
|
import { getCalloutEntry } from '../../plugins/callout/helper';
|
|
14
14
|
import './index.css';
|
|
@@ -77,11 +77,21 @@ const SideToolbar = () => {
|
|
|
77
77
|
const offsetY = !editor.editorType ? -1 : 0; // editorType is undefined means sdoc editor
|
|
78
78
|
const topValue = top + scrollRef.current.scrollTop + offsetY;
|
|
79
79
|
if (topValue !== sidePosition.top) setIsMoving(true);
|
|
80
|
+
let left = 20;
|
|
81
|
+
if (editor.editorType === WIKI_EDITOR) {
|
|
82
|
+
const {
|
|
83
|
+
left: editorLeft
|
|
84
|
+
} = document.querySelector('#sdoc-editor').getBoundingClientRect();
|
|
85
|
+
const {
|
|
86
|
+
left: containerLeft
|
|
87
|
+
} = document.querySelector('.sdoc-editor-container').getBoundingClientRect();
|
|
88
|
+
left = editorLeft - containerLeft - 40;
|
|
89
|
+
}
|
|
80
90
|
setTimeout(() => {
|
|
81
91
|
// wait animation
|
|
82
92
|
setSidePosition({
|
|
83
93
|
top: topValue,
|
|
84
|
-
left:
|
|
94
|
+
left: left
|
|
85
95
|
});
|
|
86
96
|
}, 150);
|
|
87
97
|
setSlateNode(node);
|
package/package.json
CHANGED
|
@@ -464,5 +464,8 @@
|
|
|
464
464
|
"SeaTable_column": "SeaTable column",
|
|
465
465
|
"SeaTable_table": "SeaTable table",
|
|
466
466
|
"And_x_more_records": "and {{count}} more records",
|
|
467
|
-
"Print_limit_exceeded": "Exceeding the print limit, only the first 200 lines will be printed"
|
|
467
|
+
"Print_limit_exceeded": "Exceeding the print limit, only the first 200 lines will be printed",
|
|
468
|
+
"Show_record_numbers": "Show record numbers",
|
|
469
|
+
"Alternate_color": "Alternate color",
|
|
470
|
+
"Select_column_display_option_color_tip": "Single-select and multi-select columns display option colors"
|
|
468
471
|
}
|
|
@@ -464,5 +464,8 @@
|
|
|
464
464
|
"SeaTable_column": "SeaTable column",
|
|
465
465
|
"SeaTable_table": "SeaTable table",
|
|
466
466
|
"And_x_more_records": "and {{count}} more records",
|
|
467
|
-
"Print_limit_exceeded": "Exceeding the print limit, only the first 200 lines will be printed"
|
|
467
|
+
"Print_limit_exceeded": "Exceeding the print limit, only the first 200 lines will be printed",
|
|
468
|
+
"Show_record_numbers": "Show record numbers",
|
|
469
|
+
"Alternate_color": "Alternate color",
|
|
470
|
+
"Select_column_display_option_color_tip": "Single-select and multi-select columns display option colors"
|
|
468
471
|
}
|
|
@@ -464,5 +464,8 @@
|
|
|
464
464
|
"SeaTable_column": "SeaTable column",
|
|
465
465
|
"SeaTable_table": "SeaTable table",
|
|
466
466
|
"And_x_more_records": "and {{count}} more records",
|
|
467
|
-
"Print_limit_exceeded": "Exceeding the print limit, only the first 200 lines will be printed"
|
|
467
|
+
"Print_limit_exceeded": "Exceeding the print limit, only the first 200 lines will be printed",
|
|
468
|
+
"Show_record_numbers": "Show record numbers",
|
|
469
|
+
"Alternate_color": "Alternate color",
|
|
470
|
+
"Select_column_display_option_color_tip": "Single-select and multi-select columns display option colors"
|
|
468
471
|
}
|
|
@@ -464,5 +464,8 @@
|
|
|
464
464
|
"SeaTable_column": "SeaTable column",
|
|
465
465
|
"SeaTable_table": "SeaTable table",
|
|
466
466
|
"And_x_more_records": "and {{count}} more records",
|
|
467
|
-
"Print_limit_exceeded": "Exceeding the print limit, only the first 200 lines will be printed"
|
|
467
|
+
"Print_limit_exceeded": "Exceeding the print limit, only the first 200 lines will be printed",
|
|
468
|
+
"Show_record_numbers": "Show record numbers",
|
|
469
|
+
"Alternate_color": "Alternate color",
|
|
470
|
+
"Select_column_display_option_color_tip": "Single-select and multi-select columns display option colors"
|
|
468
471
|
}
|
|
@@ -464,5 +464,8 @@
|
|
|
464
464
|
"SeaTable_column": "SeaTable column",
|
|
465
465
|
"SeaTable_table": "SeaTable table",
|
|
466
466
|
"And_x_more_records": "and {{count}} more records",
|
|
467
|
-
"Print_limit_exceeded": "Exceeding the print limit, only the first 200 lines will be printed"
|
|
467
|
+
"Print_limit_exceeded": "Exceeding the print limit, only the first 200 lines will be printed",
|
|
468
|
+
"Show_record_numbers": "Show record numbers",
|
|
469
|
+
"Alternate_color": "Alternate color",
|
|
470
|
+
"Select_column_display_option_color_tip": "Single-select and multi-select columns display option colors"
|
|
468
471
|
}
|
|
@@ -464,5 +464,8 @@
|
|
|
464
464
|
"SeaTable_column": "SeaTable column",
|
|
465
465
|
"SeaTable_table": "SeaTable table",
|
|
466
466
|
"And_x_more_records": "and {{count}} more records",
|
|
467
|
-
"Print_limit_exceeded": "Exceeding the print limit, only the first 200 lines will be printed"
|
|
467
|
+
"Print_limit_exceeded": "Exceeding the print limit, only the first 200 lines will be printed",
|
|
468
|
+
"Show_record_numbers": "Show record numbers",
|
|
469
|
+
"Alternate_color": "Alternate color",
|
|
470
|
+
"Select_column_display_option_color_tip": "Single-select and multi-select columns display option colors"
|
|
468
471
|
}
|
|
@@ -464,5 +464,8 @@
|
|
|
464
464
|
"SeaTable_column": "SeaTable column",
|
|
465
465
|
"SeaTable_table": "SeaTable table",
|
|
466
466
|
"And_x_more_records": "and {{count}} more records",
|
|
467
|
-
"Print_limit_exceeded": "Exceeding the print limit, only the first 200 lines will be printed"
|
|
467
|
+
"Print_limit_exceeded": "Exceeding the print limit, only the first 200 lines will be printed",
|
|
468
|
+
"Show_record_numbers": "Show record numbers",
|
|
469
|
+
"Alternate_color": "Alternate color",
|
|
470
|
+
"Select_column_display_option_color_tip": "Single-select and multi-select columns display option colors"
|
|
468
471
|
}
|
|
@@ -464,5 +464,8 @@
|
|
|
464
464
|
"SeaTable_column": "SeaTable column",
|
|
465
465
|
"SeaTable_table": "SeaTable table",
|
|
466
466
|
"And_x_more_records": "and {{count}} more records",
|
|
467
|
-
"Print_limit_exceeded": "Exceeding the print limit, only the first 200 lines will be printed"
|
|
467
|
+
"Print_limit_exceeded": "Exceeding the print limit, only the first 200 lines will be printed",
|
|
468
|
+
"Show_record_numbers": "Show record numbers",
|
|
469
|
+
"Alternate_color": "Alternate color",
|
|
470
|
+
"Select_column_display_option_color_tip": "Single-select and multi-select columns display option colors"
|
|
468
471
|
}
|
|
@@ -463,6 +463,9 @@
|
|
|
463
463
|
"Horizontal_align": "Горизонтальное выравнивание",
|
|
464
464
|
"SeaTable_column": "Столбец SeaTable",
|
|
465
465
|
"SeaTable_table": "Таблица SeaTable",
|
|
466
|
-
"And_x_more_records": "
|
|
467
|
-
"Print_limit_exceeded": "
|
|
466
|
+
"And_x_more_records": "и ещё {{count}} записей",
|
|
467
|
+
"Print_limit_exceeded": "При превышении лимита печати будут напечатаны только первые 200 строк",
|
|
468
|
+
"Show_record_numbers": "Show record numbers",
|
|
469
|
+
"Alternate_color": "Alternate color",
|
|
470
|
+
"Select_column_display_option_color_tip": "Single-select and multi-select columns display option colors"
|
|
468
471
|
}
|
|
@@ -464,5 +464,8 @@
|
|
|
464
464
|
"SeaTable_column": "SeaTable 列",
|
|
465
465
|
"SeaTable_table": "SeaTable 子表",
|
|
466
466
|
"And_x_more_records": "以及另外 {{count}} 条记录",
|
|
467
|
-
"Print_limit_exceeded": "超过打印限制, 只会打印前 200 行"
|
|
467
|
+
"Print_limit_exceeded": "超过打印限制, 只会打印前 200 行",
|
|
468
|
+
"Show_record_numbers": "显示记录编号",
|
|
469
|
+
"Alternate_color": "单双行不同背景色",
|
|
470
|
+
"Select_column_display_option_color_tip": "单选列和多选列显示选项颜色"
|
|
468
471
|
}
|