@seafile/sdoc-editor 1.0.33 → 1.0.35
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/commons/color-menu/index.css +2 -2
- package/dist/basic-sdk/extension/commons/menu/menu.css +0 -1
- package/dist/basic-sdk/extension/plugins/callout/plugin.js +7 -4
- package/dist/basic-sdk/extension/plugins/header/menu/index.js +1 -1
- package/dist/basic-sdk/extension/plugins/header/menu/style.css +5 -0
- package/dist/basic-sdk/extension/plugins/seatable-column/render-elem.js +4 -3
- package/dist/basic-sdk/extension/plugins/table/menu/color-selector-popover/style.css +0 -162
- package/dist/basic-sdk/extension/toolbar/header-toolbar/insert-toolbar/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import isHotkey from 'is-hotkey';
|
|
2
2
|
import { Editor, Node, Range, Transforms } from '@seafile/slate';
|
|
3
|
-
import { PARAGRAPH, INSERT_POSITION, CODE_BLOCK, CALL_OUT } from '../../constants';
|
|
3
|
+
import { PARAGRAPH, INSERT_POSITION, CODE_BLOCK, CALL_OUT, ORDERED_LIST, UNORDERED_LIST } from '../../constants';
|
|
4
4
|
import { getSelectedNodeEntryByType, isSelectionAtBlockStart } from '../../core';
|
|
5
5
|
import { deleteCalloutIcon, getCalloutEntry, isCalloutContentEmpty, unwrapCallout } from './helper';
|
|
6
6
|
import { insertElement } from '../../toolbar/side-toolbar/helpers';
|
|
@@ -56,9 +56,12 @@ const withCallout = editor => {
|
|
|
56
56
|
if (parentNodeEntry && parentNodeEntry[0].type === CALL_OUT) {
|
|
57
57
|
if (!Node.string(paragraphEntry[0]).length) {
|
|
58
58
|
insertFragment(data);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
if ([ORDERED_LIST, UNORDERED_LIST].includes(data[0].type)) {
|
|
60
|
+
Transforms.removeNodes(newEditor, {
|
|
61
|
+
at: paragraphEntry[1]
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return;
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
67
|
}
|
|
@@ -107,7 +107,7 @@ class HeaderMenu extends React.Component {
|
|
|
107
107
|
onClick: disabled ? () => {} : this.onToggleClick
|
|
108
108
|
}, /*#__PURE__*/React.createElement("span", {
|
|
109
109
|
className: "active"
|
|
110
|
-
}, t(HEADER_TITLE_MAP[currentType])),
|
|
110
|
+
}, t(HEADER_TITLE_MAP[currentType])), /*#__PURE__*/React.createElement("span", {
|
|
111
111
|
className: headerIconClass
|
|
112
112
|
})), isShowHeaderPopover && /*#__PURE__*/React.createElement("div", {
|
|
113
113
|
ref: this.setMenuRef,
|
|
@@ -30,10 +30,11 @@ const Column = _ref => {
|
|
|
30
30
|
setIsClicked(false);
|
|
31
31
|
}
|
|
32
32
|
}, [isSelected, isReadOnly]);
|
|
33
|
-
const style = _objectSpread(
|
|
33
|
+
const style = _objectSpread({
|
|
34
|
+
margin: '0 10px',
|
|
35
|
+
border: '1px solid transparent'
|
|
36
|
+
}, isClicked && {
|
|
34
37
|
border: '1px solid red'
|
|
35
|
-
}), {}, {
|
|
36
|
-
margin: '0 10px'
|
|
37
38
|
});
|
|
38
39
|
return /*#__PURE__*/React.createElement("span", Object.assign({}, attributes, {
|
|
39
40
|
style: style
|
|
@@ -1,165 +1,3 @@
|
|
|
1
|
-
.menu-group .sdoc-color-menu.menu-show {
|
|
2
|
-
background: #e5e5e5;
|
|
3
|
-
border-radius: 2px;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.menu-group .sdoc-color-menu .last-used-color-container {
|
|
7
|
-
height: 100%;
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-direction: column;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
align-items: center;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.menu-group .sdoc-color-menu .last-used-color-container.disabled {
|
|
15
|
-
padding-right: 0;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.menu-group .sdoc-color-menu .sdoc-color-toggle {
|
|
19
|
-
height: 100%;
|
|
20
|
-
display: flex;
|
|
21
|
-
align-items: center;
|
|
22
|
-
justify-content: center;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.menu-group .sdoc-color-menu .sdoc-color-toggle:hover,
|
|
26
|
-
.menu-group .sdoc-color-menu .last-used-color-container:not(.disabled):hover {
|
|
27
|
-
background-color: #E5E5E5;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.menu-group .sdoc-color-menu.disabled .sdoc-color-toggle {
|
|
31
|
-
display: none;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.sdoc-color-menu .sdoc-color-icon {
|
|
35
|
-
height: 12px;
|
|
36
|
-
width: 12px;
|
|
37
|
-
transform: scale(.85);
|
|
38
|
-
line-height: 12px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.sdoc-color-menu .last-used-color {
|
|
42
|
-
width: 14px;
|
|
43
|
-
height: 3px;
|
|
44
|
-
border-radius: 1px;
|
|
45
|
-
margin-top: 1px;
|
|
46
|
-
border: 1px solid rgba(0, 0, 0, .08);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.sdoc-color-menu-popover .popover {
|
|
50
|
-
left: -24px !important;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.sdoc-color-menu-popover .sdoc-color-dropdown-menu {
|
|
54
|
-
width: 251px;
|
|
55
|
-
padding: 0 0 12px 0;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.sdoc-color-menu-popover .sdoc-color-no-color-container {
|
|
59
|
-
width: 100%;
|
|
60
|
-
height: 24px;
|
|
61
|
-
margin-bottom: 5px;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.sdoc-color-menu-popover .sdoc-color-no-color-content {
|
|
65
|
-
height: 100%;
|
|
66
|
-
width: 100%;
|
|
67
|
-
text-align: center;
|
|
68
|
-
border: 1px solid rgba(0, 0, 0, .12);
|
|
69
|
-
border-radius: 2px;
|
|
70
|
-
font-size: 12px;
|
|
71
|
-
line-height: 22px;
|
|
72
|
-
cursor: pointer;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.sdoc-color-menu-popover .sdoc-color-default-colors-container {
|
|
76
|
-
display: flex;
|
|
77
|
-
flex-wrap: wrap;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.sdoc-color-menu-popover .sdoc-color-item {
|
|
81
|
-
position: relative;
|
|
82
|
-
height: 20px;
|
|
83
|
-
width: 20px;
|
|
84
|
-
margin-right: 3px;
|
|
85
|
-
margin-bottom: 3px;
|
|
86
|
-
border: 0.5px solid rgba(0, 0, 0, .08);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.sdoc-color-menu-popover .sdoc-color-item:not(.selected):hover::before {
|
|
90
|
-
content: '';
|
|
91
|
-
position: absolute;
|
|
92
|
-
width: calc(100% + 5px);
|
|
93
|
-
height: calc((100% + 5px));
|
|
94
|
-
top: -2.5px;
|
|
95
|
-
left: -2.5px;
|
|
96
|
-
pointer-events: none;
|
|
97
|
-
border: 1px solid rgba(0, 0, 0, .24);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.sdoc-color-menu-popover .sdoc-color-item.selected::after {
|
|
101
|
-
content: '';
|
|
102
|
-
position: absolute;
|
|
103
|
-
width: calc(100% + 5px);
|
|
104
|
-
height: calc((100% + 5px));
|
|
105
|
-
top: -2.5px;
|
|
106
|
-
left: -2.5px;
|
|
107
|
-
pointer-events: none;
|
|
108
|
-
border: 1px solid rgba(0, 0, 0, .88);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.sdoc-color-menu-popover .sdoc-color-item:hover {
|
|
112
|
-
cursor: pointer;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.sdoc-color-menu-popover .sdoc-color-item:nth-child(10n) {
|
|
116
|
-
margin-right: 0px;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.sdoc-color-menu-popover .sdoc-color-sub-title {
|
|
120
|
-
font-size: 11px;
|
|
121
|
-
line-height: 16px;
|
|
122
|
-
margin: 7px 0;
|
|
123
|
-
color: rgba(0, 0, 0, 0.4);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.sdoc-color-menu-popover .sdoc-colors-divider {
|
|
127
|
-
width: 100%;
|
|
128
|
-
height: 1px;
|
|
129
|
-
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
|
|
130
|
-
margin: 0px 0 8px 0;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.sdoc-color-menu-popover .sdoc-more-colors {
|
|
134
|
-
display: flex;
|
|
135
|
-
align-items: center;
|
|
136
|
-
justify-content: space-between;
|
|
137
|
-
height: 30px;
|
|
138
|
-
font-size: 12px;
|
|
139
|
-
padding: 0 12px;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.sdoc-color-menu-popover .sdoc-more-colors .sdocfont {
|
|
143
|
-
font-size: 12px;
|
|
144
|
-
transform: scale(.6);
|
|
145
|
-
color: #888;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.sdoc-color-menu-popover .sdoc-more-colors.show-pick {
|
|
149
|
-
cursor: pointer;
|
|
150
|
-
background-color: rgba(51, 77, 102, .06);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.sdoc-more-colors-popover .popover {
|
|
154
|
-
left: 10px !important;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/* commission */
|
|
158
|
-
.menu-group #button-sdoc-highlight-color .sdoc-color-icon {
|
|
159
|
-
position: relative;
|
|
160
|
-
left: 1px;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
1
|
.sdoc-table-cell-bg-colors-popover .popover {
|
|
164
2
|
margin-left: 30px;
|
|
165
3
|
}
|
|
@@ -67,7 +67,7 @@ const InsertToolbar = _ref => {
|
|
|
67
67
|
className: "sdocfont sdoc-insert mr-1"
|
|
68
68
|
}), /*#__PURE__*/React.createElement("span", {
|
|
69
69
|
className: "text-truncate"
|
|
70
|
-
}, t('Insert'))),
|
|
70
|
+
}, t('Insert'))), /*#__PURE__*/React.createElement("div", {
|
|
71
71
|
className: "sdoc-menu-with-dropdown-triangle"
|
|
72
72
|
}, /*#__PURE__*/React.createElement("span", {
|
|
73
73
|
className: caretIconClass
|