@seafile/sdoc-editor 3.0.257-alpha.4 → 3.0.258
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/LICENSE.txt +13 -0
- package/dist/assets/css/default.css +2 -2
- package/dist/assets/css/dropdown-menu.css +6 -6
- package/dist/assets/css/layout.css +4 -8
- package/dist/assets/css/popover.css +1 -1
- package/dist/assets/css/sdoc-editor-article.css +1 -10
- package/dist/assets/css/sdoc-editor-plugins.css +1 -31
- package/dist/comment/components/comment-all-participants/index.css +4 -9
- package/dist/comment/components/comment-context-menu/index.css +3 -3
- package/dist/comment/components/comment-list.css +11 -127
- package/dist/comment/components/comment-participants-editor/index.css +10 -10
- package/dist/comment/components/elements-comment-count/index.css +0 -8
- package/dist/comment/components/global-comment/index.css +11 -59
- package/dist/comment/components/style.css +1 -9
- package/dist/constants/index.js +1 -1
- package/dist/extension/commons/color-menu/index.css +8 -8
- package/dist/extension/commons/dropdown-menu-item/index.css +1 -1
- package/dist/extension/commons/menu/menu.css +6 -6
- package/dist/extension/commons/select/menu/style.css +7 -7
- package/dist/extension/commons/select/style.css +5 -5
- package/dist/extension/plugins/callout/render-elem/callout-color-selector/style.css +2 -2
- package/dist/extension/plugins/callout/render-elem/callout-hover-menu/style.css +8 -8
- package/dist/extension/plugins/callout/render-elem/callout-icon/style.css +3 -3
- package/dist/extension/plugins/callout/render-elem/index.css +0 -5
- package/dist/extension/plugins/callout/render-elem/index.js +0 -3
- package/dist/extension/plugins/code-block/element.css +8 -28
- package/dist/extension/plugins/code-block/hover-menu/index.css +12 -12
- package/dist/extension/plugins/embed-link/hover-menu/index.css +7 -7
- package/dist/extension/plugins/file-link/hover-menu/index.css +14 -24
- package/dist/extension/plugins/file-link/render-elem.css +1 -22
- package/dist/extension/plugins/formula/hover-menu/index.css +7 -7
- package/dist/extension/plugins/header/menu/style.css +7 -7
- package/dist/extension/plugins/image/hover-menu/index.css +11 -11
- package/dist/extension/plugins/link/dialog/add-link-dialog/index.css +10 -11
- package/dist/extension/plugins/link/dialog/add-link-dialog/select-forms/linked-page.css +5 -5
- package/dist/extension/plugins/link/hover/index.css +13 -13
- package/dist/extension/plugins/sdoc-link/hover-menu/index.css +14 -24
- package/dist/extension/plugins/sdoc-link/render/render-elem.css +2 -22
- package/dist/extension/plugins/search-replace/helper.js +2 -1
- package/dist/extension/plugins/search-replace/popover/index.css +7 -7
- package/dist/extension/plugins/table/popover/table-size-popover/index.css +8 -7
- package/dist/extension/plugins/table/popover/table-size-popover/index.js +30 -13
- package/dist/extension/plugins/table/popover/table-template/index.css +5 -5
- package/dist/extension/plugins/table/popover/table-template/index.js +14 -1
- package/dist/extension/plugins/table/render/index.css +0 -13
- package/dist/extension/plugins/table/render/table-header/index.css +0 -17
- package/dist/extension/plugins/text-style/helpers.js +1 -8
- package/dist/extension/plugins/text-style/render-elem.js +1 -9
- package/dist/extension/plugins/video/hover-menu/index.css +7 -7
- package/dist/extension/plugins/whiteboard/hover-menu/index.css +7 -7
- package/dist/extension/toolbar/context-toolbar/index.css +3 -3
- package/dist/extension/toolbar/quick-insert-toolbar/index.js +117 -15
- package/dist/extension/toolbar/quick-insert-toolbar/style.css +14 -2
- package/dist/extension/toolbar/side-toolbar/index.css +0 -12
- package/dist/extension/toolbar/side-toolbar/side-menu.css +6 -7
- package/dist/extension/utils/index.js +15 -20
- package/dist/node-id/index.js +94 -15
- package/dist/outline/style.css +3 -49
- package/dist/right-panel/index.css +0 -4
- package/dist/wiki-outline/style.css +0 -12
- package/package.json +2 -2
|
@@ -8,24 +8,24 @@
|
|
|
8
8
|
.sdoc-link-hover-menu-container .hover-menu-container {
|
|
9
9
|
height: 40px;
|
|
10
10
|
padding: 8px;
|
|
11
|
-
background-color:
|
|
11
|
+
background-color: #fff;
|
|
12
12
|
display: flex;
|
|
13
13
|
justify-content: flex-start;
|
|
14
14
|
align-items: center;
|
|
15
|
-
border: 1px solid
|
|
15
|
+
border: 1px solid #eee;
|
|
16
16
|
border-radius: 8px;
|
|
17
|
-
box-shadow:
|
|
17
|
+
box-shadow: 0 6px 14px 0 rgba(0, 0, 0, 0.10);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.sdoc-link-hover-menu-container .hover-menu-container>span:not(:last-of-type) {
|
|
21
21
|
padding-right: 8px;
|
|
22
|
-
border-right: 1px solid
|
|
22
|
+
border-right: 1px solid #e5e5e5;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.sdoc-link-hover-menu-container .hover-menu-container .op-item {
|
|
26
26
|
position: relative;
|
|
27
27
|
font-size: 12px;
|
|
28
|
-
color:
|
|
28
|
+
color: #212529;
|
|
29
29
|
padding: 0 5px;
|
|
30
30
|
border-radius: 2px;
|
|
31
31
|
min-width: 24px;
|
|
@@ -37,17 +37,7 @@
|
|
|
37
37
|
|
|
38
38
|
.sdoc-link-hover-menu-container .hover-menu-container .op-item:hover {
|
|
39
39
|
text-decoration: none;
|
|
40
|
-
background:
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.sdoc-link-hover-menu-container .hover-menu-container .link-op-menu-link {
|
|
44
|
-
color: var(--bs-body-color, #212529);
|
|
45
|
-
background: transparent;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.sdoc-link-hover-menu-container .hover-menu-container .link-op-menu-link:hover {
|
|
49
|
-
color: var(--bs-body-color, #212529);
|
|
50
|
-
background: var(--bs-dropdown-link-hover-bg, #EFEFEF);
|
|
40
|
+
background: #EFEFEF;
|
|
51
41
|
}
|
|
52
42
|
|
|
53
43
|
.sdoc-link-hover-menu-container .op-group-item:not(:first-child) .op-item {
|
|
@@ -55,12 +45,12 @@
|
|
|
55
45
|
}
|
|
56
46
|
|
|
57
47
|
.sdoc-link-hover-menu-container .hover-menu-container .link-style-icon-active {
|
|
58
|
-
background:
|
|
48
|
+
background: #EFEFEF;
|
|
59
49
|
}
|
|
60
50
|
|
|
61
51
|
.sdoc-link-hover-menu-container .hover-menu-container .op-tooltip:hover::after {
|
|
62
52
|
position: absolute;
|
|
63
|
-
color:
|
|
53
|
+
color: #212529;
|
|
64
54
|
content: attr(op-item-tooltip);
|
|
65
55
|
top: -40px;
|
|
66
56
|
left: -20px;
|
|
@@ -69,9 +59,9 @@
|
|
|
69
59
|
display: flex;
|
|
70
60
|
justify-content: center;
|
|
71
61
|
align-items: center;
|
|
72
|
-
background-color:
|
|
62
|
+
background-color: #fff;
|
|
73
63
|
border-radius: 3px;
|
|
74
|
-
border: 1px solid
|
|
64
|
+
border: 1px solid #e8e8e8;
|
|
75
65
|
font-size: 12px;
|
|
76
66
|
box-shadow: 0 0 5px #ccc;
|
|
77
67
|
}
|
|
@@ -79,7 +69,7 @@
|
|
|
79
69
|
.sdoc-link-hover-menu-container .hover-menu-container .sdocfont {
|
|
80
70
|
line-height: 1;
|
|
81
71
|
font-size: 14px;
|
|
82
|
-
color:
|
|
72
|
+
color: #666;
|
|
83
73
|
}
|
|
84
74
|
|
|
85
75
|
.sdoc-link-hover-menu-container .hover-menu-container .sdoc-arrow-down {
|
|
@@ -90,10 +80,10 @@
|
|
|
90
80
|
position: absolute;
|
|
91
81
|
top: 32px;
|
|
92
82
|
left: 0px;
|
|
93
|
-
background-color:
|
|
94
|
-
border: 1px solid
|
|
83
|
+
background-color: #fff;
|
|
84
|
+
border: 1px solid #eee;
|
|
95
85
|
border-radius: 8px;
|
|
96
|
-
box-shadow:
|
|
86
|
+
box-shadow: 0 6px 14px 0 rgba(0, 0, 0, 0.1);
|
|
97
87
|
display: flex;
|
|
98
88
|
flex-direction: column;
|
|
99
89
|
align-items: flex-start;
|
|
@@ -17,10 +17,6 @@
|
|
|
17
17
|
border-radius: 3px;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
[data-bs-theme="dark"] .sdoc-file-render:hover .sdoc-file-text-link a {
|
|
21
|
-
text-decoration-color: var(--bs-border-color);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
20
|
.sdoc-file-card-link {
|
|
25
21
|
position: relative;
|
|
26
22
|
background-color: #f3f3f3;
|
|
@@ -35,13 +31,9 @@
|
|
|
35
31
|
margin-right: 1px;
|
|
36
32
|
}
|
|
37
33
|
|
|
38
|
-
[data-bs-theme="dark"] .sdoc-file-card-link {
|
|
39
|
-
background-color: var(--bs-bg-file-card-color);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
34
|
.sdoc-file-render .sdoc-file-link-icon {
|
|
43
35
|
padding-right: 5px;
|
|
44
|
-
color:
|
|
36
|
+
color: #666;
|
|
45
37
|
}
|
|
46
38
|
|
|
47
39
|
.sdoc-file-card-link .sdoc-file-link-icon :first-child {
|
|
@@ -66,19 +58,13 @@
|
|
|
66
58
|
.sdoc-file-render .sdoc-file-text-link.sdoc-no-file-link-icon a,
|
|
67
59
|
.sdoc-file-render .sdoc-file-text-link a,
|
|
68
60
|
.sdoc-file-render .sdoc-file-card-link a {
|
|
69
|
-
color:
|
|
61
|
+
color: #212529;
|
|
70
62
|
font-weight: 500;
|
|
71
63
|
text-decoration: underline;
|
|
72
64
|
text-underline-position: under;
|
|
73
65
|
text-decoration-color: rgb(55 53 47 / 25%);
|
|
74
66
|
}
|
|
75
67
|
|
|
76
|
-
[data-bs-theme="dark"] .sdoc-file-render .sdoc-file-text-link.sdoc-no-file-link-icon a,
|
|
77
|
-
[data-bs-theme="dark"] .sdoc-file-render .sdoc-file-text-link a,
|
|
78
|
-
[data-bs-theme="dark"] .sdoc-file-render .sdoc-file-card-link a {
|
|
79
|
-
text-decoration-color: var(--bs-border-color);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
68
|
.sdoc-file-render .sdoc-file-text-link.sdoc-no-file-link-icon a:hover,
|
|
83
69
|
.sdoc-file-render .sdoc-file-text-link a:hover,
|
|
84
70
|
.sdoc-file-render .sdoc-file-card-link a:hover {
|
|
@@ -89,12 +75,6 @@
|
|
|
89
75
|
border-radius: 3px;
|
|
90
76
|
}
|
|
91
77
|
|
|
92
|
-
[data-bs-theme="dark"] .sdoc-file-render .sdoc-file-text-link.sdoc-no-file-link-icon a:hover,
|
|
93
|
-
[data-bs-theme="dark"] .sdoc-file-render .sdoc-file-text-link a:hover,
|
|
94
|
-
[data-bs-theme="dark"] .sdoc-file-render .sdoc-file-card-link a:hover {
|
|
95
|
-
text-decoration-color: var(--bs-border-color);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
78
|
.sdoc-file-card-link .sdoc-file-text-link {
|
|
99
79
|
position: absolute;
|
|
100
80
|
left: 42px;
|
|
@@ -51,7 +51,8 @@ var splitTextNode = function splitTextNode(node) {
|
|
|
51
51
|
};
|
|
52
52
|
var matchSearchWordPosition = function matchSearchWordPosition(node, searchWord) {
|
|
53
53
|
var content = _slate.Node.string(node);
|
|
54
|
-
var
|
|
54
|
+
var escapedSearchWord = searchWord.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
55
|
+
var regex = new RegExp(escapedSearchWord, 'gi');
|
|
55
56
|
var matches = (0, _toConsumableArray2["default"])(content.matchAll(regex));
|
|
56
57
|
return matches.map(function (match) {
|
|
57
58
|
return match.index;
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
width: 400px;
|
|
4
4
|
height: 280px;
|
|
5
5
|
z-index: 102;
|
|
6
|
-
background:
|
|
7
|
-
border: 1px solid
|
|
6
|
+
background: #fff;
|
|
7
|
+
border: 1px solid #eee;
|
|
8
8
|
border-radius: 8px;
|
|
9
|
-
box-shadow:
|
|
9
|
+
box-shadow: 0 6px 14px 0 rgba(0, 0, 0, 0.1);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.sdoc-search-replace-popover-container.in-wiki {
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
display: flex;
|
|
20
20
|
justify-content: space-between;
|
|
21
21
|
padding: 10px 15px;
|
|
22
|
-
border-bottom: 1px solid
|
|
22
|
+
border-bottom: 1px solid #eee;
|
|
23
23
|
pointer-events: none;
|
|
24
24
|
user-select: none;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.sdoc-search-replace-popover-container .sdoc-search-replace-popover-title .sdoc-search-replace-title-text {
|
|
28
28
|
font-weight: 600;
|
|
29
|
-
color:
|
|
29
|
+
color: #333;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.sdoc-search-replace-popover-container .sdoc-search-replace-popover-title .sdoc-search-replace-title-close {
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
display: flex;
|
|
37
37
|
justify-content: center;
|
|
38
38
|
border-radius: 2px;
|
|
39
|
-
color:
|
|
39
|
+
color: #666;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.sdoc-search-replace-popover-container .sdoc-search-replace-popover-title .sdoc-search-replace-title-close:hover {
|
|
43
|
-
background-color:
|
|
43
|
+
background-color: #EFEFEF;
|
|
44
44
|
cursor: pointer;
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.sdoc-selected-table-size-container .sdoc-selected-table-tools-container {
|
|
2
2
|
padding-bottom: 8px;
|
|
3
3
|
margin-bottom: 8px;
|
|
4
|
-
border-bottom: 1px solid
|
|
4
|
+
border-bottom: 1px solid #eee;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.sdoc-selected-table-size-popover .sdoc-selected-table-size-custom {
|
|
@@ -12,9 +12,10 @@
|
|
|
12
12
|
min-height: 32px;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.sdoc-selected-table-size-popover .sdoc-selected-table-size-custom:hover
|
|
15
|
+
.sdoc-selected-table-size-popover .sdoc-selected-table-size-custom:hover,
|
|
16
|
+
.sdoc-selected-table-size-popover .sdoc-selected-table-size-custom.keyboard-selected {
|
|
16
17
|
cursor: pointer;
|
|
17
|
-
background:
|
|
18
|
+
background: #f5f5f5;
|
|
18
19
|
border-radius: 4px;
|
|
19
20
|
}
|
|
20
21
|
|
|
@@ -28,22 +29,22 @@
|
|
|
28
29
|
|
|
29
30
|
.sdoc-selected-table-size-popover .sdoc-table-size-row {
|
|
30
31
|
flex-direction: row;
|
|
31
|
-
border-bottom: 1px solid
|
|
32
|
+
border-bottom: 1px solid #ccc;
|
|
32
33
|
width: fit-content;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
.sdoc-selected-table-size-popover .sdoc-table-size-row:first-child {
|
|
36
|
-
border-top: 1px solid
|
|
37
|
+
border-top: 1px solid #ccc;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
.sdoc-selected-table-size-popover .sdoc-table-size-cell {
|
|
40
|
-
border-right: 1px solid
|
|
41
|
+
border-right: 1px solid #ccc;
|
|
41
42
|
width: 20px;
|
|
42
43
|
height: 15px;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
.sdoc-selected-table-size-popover .sdoc-table-size-row .sdoc-table-size-cell:first-child {
|
|
46
|
-
border-left: 1px solid
|
|
47
|
+
border-left: 1px solid #ccc;
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
.sdoc-selected-table-size-popover .sdoc-table-size-cell.active {
|
|
@@ -38,6 +38,10 @@ var TableSizePopover = function TableSizePopover(_ref) {
|
|
|
38
38
|
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
39
39
|
selectedSize = _useState4[0],
|
|
40
40
|
setSelectedSize = _useState4[1];
|
|
41
|
+
var _useState5 = (0, _react.useState)(false),
|
|
42
|
+
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
43
|
+
isTemplateSelected = _useState6[0],
|
|
44
|
+
setIsTemplateSelected = _useState6[1];
|
|
41
45
|
var ref = (0, _react.useRef)(null);
|
|
42
46
|
var templateRef = (0, _react.useRef)(null);
|
|
43
47
|
(0, _react.useEffect)(function () {
|
|
@@ -68,9 +72,12 @@ var TableSizePopover = function TableSizePopover(_ref) {
|
|
|
68
72
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
69
73
|
}, [selectedSize, ref]);
|
|
70
74
|
var onTemplateItemSelectedStyle = (0, _react.useCallback)(function (color) {
|
|
71
|
-
|
|
72
|
-
templateEl.style['backgroundColor'] = color;
|
|
75
|
+
setIsTemplateSelected(Boolean(color));
|
|
73
76
|
}, []);
|
|
77
|
+
var selectFirstMenuItem = (0, _react.useCallback)(function () {
|
|
78
|
+
ref.current['firstRender'] = false;
|
|
79
|
+
onTemplateItemSelectedStyle('#f5f5f5');
|
|
80
|
+
}, [onTemplateItemSelectedStyle]);
|
|
74
81
|
var handleSizeDown = (0, _react.useCallback)(function (e) {
|
|
75
82
|
var keyCode = e.keyCode;
|
|
76
83
|
var UpArrow = _constants.KeyCodes.UpArrow,
|
|
@@ -118,9 +125,8 @@ var TableSizePopover = function TableSizePopover(_ref) {
|
|
|
118
125
|
LeftArrow = _constants.KeyCodes.LeftArrow,
|
|
119
126
|
Esc = _constants.KeyCodes.Esc;
|
|
120
127
|
var isInitSize = selectedSize[0] === 1 && selectedSize[1] === 1;
|
|
121
|
-
var templateEl = document.getElementById('sdoc-table-template-review-btn');
|
|
122
128
|
// Currently focusing on the template menu item
|
|
123
|
-
if (
|
|
129
|
+
if (isTemplateSelected) {
|
|
124
130
|
if (keyCode === DownArrow) {
|
|
125
131
|
e.preventDefault();
|
|
126
132
|
onTemplateItemSelectedStyle('');
|
|
@@ -134,8 +140,11 @@ var TableSizePopover = function TableSizePopover(_ref) {
|
|
|
134
140
|
}
|
|
135
141
|
if (keyCode === Enter) {
|
|
136
142
|
e.preventDefault();
|
|
137
|
-
|
|
138
|
-
|
|
143
|
+
templateRef.current.openWithKeyboard();
|
|
144
|
+
}
|
|
145
|
+
if (keyCode === RightArrow) {
|
|
146
|
+
e.preventDefault();
|
|
147
|
+
templateRef.current.openWithKeyboard();
|
|
139
148
|
}
|
|
140
149
|
if (keyCode === Esc) {
|
|
141
150
|
e.preventDefault();
|
|
@@ -153,7 +162,7 @@ var TableSizePopover = function TableSizePopover(_ref) {
|
|
|
153
162
|
e.preventDefault();
|
|
154
163
|
if (ref.current['firstRender']) {
|
|
155
164
|
ref.current['firstRender'] = false;
|
|
156
|
-
onTemplateItemSelectedStyle('
|
|
165
|
+
onTemplateItemSelectedStyle('#f5f5f5');
|
|
157
166
|
return;
|
|
158
167
|
}
|
|
159
168
|
handleSizeDown(e);
|
|
@@ -163,7 +172,7 @@ var TableSizePopover = function TableSizePopover(_ref) {
|
|
|
163
172
|
if (keyCode === UpArrow) {
|
|
164
173
|
e.preventDefault();
|
|
165
174
|
if (isInitSize) {
|
|
166
|
-
onTemplateItemSelectedStyle('
|
|
175
|
+
onTemplateItemSelectedStyle('#f5f5f5');
|
|
167
176
|
} else {
|
|
168
177
|
handleSizeDown(e);
|
|
169
178
|
}
|
|
@@ -183,10 +192,15 @@ var TableSizePopover = function TableSizePopover(_ref) {
|
|
|
183
192
|
e.preventDefault();
|
|
184
193
|
handleClosePopover();
|
|
185
194
|
}
|
|
186
|
-
}, [handleClosePopover, handleSizeDown, onTemplateItemSelectedStyle, selectedSize]);
|
|
195
|
+
}, [handleClosePopover, handleSizeDown, isTemplateSelected, onTemplateItemSelectedStyle, selectedSize]);
|
|
196
|
+
var onPopoverClosed = (0, _react.useCallback)(function () {
|
|
197
|
+
setIsTemplateSelected(false);
|
|
198
|
+
ref.current['firstRender'] = true;
|
|
199
|
+
}, []);
|
|
187
200
|
(0, _react.useImperativeHandle)(tableSizeRef, function () {
|
|
188
201
|
return {
|
|
189
202
|
handleTableSizeKeyDown: handleTableSizeKeyDown,
|
|
203
|
+
selectFirstMenuItem: selectFirstMenuItem,
|
|
190
204
|
uncontrolledPopoverRef: ref
|
|
191
205
|
};
|
|
192
206
|
});
|
|
@@ -230,6 +244,7 @@ var TableSizePopover = function TableSizePopover(_ref) {
|
|
|
230
244
|
placement: placement,
|
|
231
245
|
hideArrow: true,
|
|
232
246
|
fade: false,
|
|
247
|
+
onClosed: onPopoverClosed,
|
|
233
248
|
ref: ref,
|
|
234
249
|
popperClassName: "".concat(popperClassName, " sdoc-popover-box-shadow"),
|
|
235
250
|
offset: offset
|
|
@@ -240,7 +255,8 @@ var TableSizePopover = function TableSizePopover(_ref) {
|
|
|
240
255
|
}, /*#__PURE__*/_react["default"].createElement(MenuItem, {
|
|
241
256
|
id: "sdoc-table-template-review-btn",
|
|
242
257
|
text: "Table_template",
|
|
243
|
-
iconClassname: "sdocfont sdoc-arrow-right sdoc-dropdown-item-right-icon"
|
|
258
|
+
iconClassname: "sdocfont sdoc-arrow-right sdoc-dropdown-item-right-icon",
|
|
259
|
+
isSelected: isTemplateSelected
|
|
244
260
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
245
261
|
className: "sdoc-table-size-select"
|
|
246
262
|
}, renderTableSize()), /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -258,13 +274,14 @@ var MenuItem = function MenuItem(_ref2) {
|
|
|
258
274
|
var id = _ref2.id,
|
|
259
275
|
className = _ref2.className,
|
|
260
276
|
text = _ref2.text,
|
|
261
|
-
iconClassname = _ref2.iconClassname
|
|
277
|
+
iconClassname = _ref2.iconClassname,
|
|
278
|
+
isSelected = _ref2.isSelected;
|
|
262
279
|
var _useTranslation = (0, _reactI18next.useTranslation)('sdoc-editor'),
|
|
263
280
|
t = _useTranslation.t;
|
|
264
281
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
265
282
|
id: id,
|
|
266
|
-
className: (0, _classnames["default"])('sdoc-selected-table-size-custom', {
|
|
267
|
-
|
|
283
|
+
className: (0, _classnames["default"])('sdoc-selected-table-size-custom', className, {
|
|
284
|
+
'keyboard-selected': isSelected
|
|
268
285
|
})
|
|
269
286
|
}, /*#__PURE__*/_react["default"].createElement("span", null, t(text)), /*#__PURE__*/_react["default"].createElement("i", {
|
|
270
287
|
className: iconClassname
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.sdoc-table-template-popover .popover {
|
|
6
|
-
background-color:
|
|
6
|
+
background-color: #fff;
|
|
7
7
|
border-radius: 8px;
|
|
8
8
|
overflow: hidden;
|
|
9
9
|
}
|
|
@@ -14,22 +14,22 @@
|
|
|
14
14
|
padding: 10px;
|
|
15
15
|
width: 310px;
|
|
16
16
|
height: 100%;
|
|
17
|
-
background-color:
|
|
17
|
+
background-color: #fff;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.sdoc-table-template-view-table {
|
|
21
21
|
padding: 10px;
|
|
22
22
|
margin: 10px 5px;
|
|
23
|
-
border: 1px solid
|
|
23
|
+
border: 1px solid #e2e3e6;
|
|
24
24
|
cursor: pointer;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.sdoc-table-template-view-table:hover {
|
|
28
|
-
box-shadow: 0 0 3px 2px
|
|
28
|
+
box-shadow: 0 0 3px 2px #e2e3e6;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.sdoc-table-template-view-table.active {
|
|
32
|
-
box-shadow: 0 0 3px 2px
|
|
32
|
+
box-shadow: 0 0 3px 2px #e2e3e6;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.sdoc-table-template-view-table .sdoc-table-template-row .sdoc-table-template-cell {
|
|
@@ -51,7 +51,13 @@ var TableTemplate = function TableTemplate(_ref) {
|
|
|
51
51
|
var newPosition = [position[0] - 1, position[1]];
|
|
52
52
|
ref.current.position = newPosition;
|
|
53
53
|
setPosition(newPosition);
|
|
54
|
+
} else {
|
|
55
|
+
var initialPosition = [-1, -1];
|
|
56
|
+
ref.current.position = initialPosition;
|
|
57
|
+
setPosition(initialPosition);
|
|
58
|
+
ref.current.toggle();
|
|
54
59
|
}
|
|
60
|
+
return;
|
|
55
61
|
}
|
|
56
62
|
if (keyCode === RightArrow) {
|
|
57
63
|
e.preventDefault();
|
|
@@ -101,12 +107,19 @@ var TableTemplate = function TableTemplate(_ref) {
|
|
|
101
107
|
handleClosePopover();
|
|
102
108
|
}
|
|
103
109
|
}, [handleClickTemplate, handleClosePopover]);
|
|
110
|
+
var openWithKeyboard = (0, _react.useCallback)(function () {
|
|
111
|
+
var firstPosition = [0, 0];
|
|
112
|
+
ref.current.position = firstPosition;
|
|
113
|
+
setPosition(firstPosition);
|
|
114
|
+
ref.current.toggle();
|
|
115
|
+
}, []);
|
|
104
116
|
(0, _react.useImperativeHandle)(templateRef, function () {
|
|
105
117
|
return {
|
|
106
118
|
handleTableTemplateKeyDown: handleTableTemplateKeyDown,
|
|
119
|
+
openWithKeyboard: openWithKeyboard,
|
|
107
120
|
uncontrolledTemplatePopoverRef: ref
|
|
108
121
|
};
|
|
109
|
-
});
|
|
122
|
+
}, [handleTableTemplateKeyDown, openWithKeyboard]);
|
|
110
123
|
(0, _react.useEffect)(function () {
|
|
111
124
|
ref.current.position = [-1, -1];
|
|
112
125
|
}, []);
|
|
@@ -60,19 +60,6 @@
|
|
|
60
60
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
[data-bs-theme="dark"] .sdoc-table-wrapper .table-cell {
|
|
64
|
-
border-right: 1px solid var(--bs-border-color);
|
|
65
|
-
border-bottom: 1px solid var(--bs-border-color);
|
|
66
|
-
/* The first row and column keep their light borders inline in render-cell.js. */
|
|
67
|
-
border-top-color: var(--bs-border-color) !important;
|
|
68
|
-
border-left-color: var(--bs-border-color) !important;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/* render-cell.js sets the light selection color inline. */
|
|
72
|
-
[data-bs-theme="dark"] .sdoc-table-wrapper .table-cell.cell-selected {
|
|
73
|
-
background-color: var(--bs-tr-active-bg) !important;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
63
|
.sdoc-cell-container {
|
|
77
64
|
width: 100%;
|
|
78
65
|
}
|
|
@@ -82,20 +82,3 @@
|
|
|
82
82
|
cursor: pointer;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
[data-bs-theme="dark"] .sdoc-table-wrapper .sdoc-table-columns-header .sdoc-table-column-header,
|
|
87
|
-
[data-bs-theme="dark"] .sdoc-table-wrapper .sdoc-table-row-header,
|
|
88
|
-
[data-bs-theme="dark"] .sdoc-table-wrapper .sdoc-table-rows-columns-header {
|
|
89
|
-
background-color: var(--bs-th-tertiary-bg);
|
|
90
|
-
border-color: var(--bs-border-color);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
[data-bs-theme="dark"] .sdoc-table-wrapper .sdoc-table-row-header.range-selected-tip,
|
|
94
|
-
[data-bs-theme="dark"] .sdoc-table-wrapper .sdoc-table-column-header.range-selected-tip,
|
|
95
|
-
[data-bs-theme="dark"] .sdoc-table-wrapper .sdoc-table-rows-columns-header.range-selected-tip {
|
|
96
|
-
background-color: var(--bs-th-fifth-bg);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
[data-bs-theme="dark"] .sdoc-table-wrapper .sdoc-table-add-element-icon-content {
|
|
100
|
-
background-color: var(--bs-border-tertiary-color);
|
|
101
|
-
}
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.removeMark = exports.isTextCommentExist = exports.isMenuDisabled = exports.getValue = exports.
|
|
7
|
+
exports.removeMark = exports.isTextCommentExist = exports.isMenuDisabled = exports.getValue = exports.addMark = void 0;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
9
9
|
var _slate = require("@seafile/slate");
|
|
10
10
|
var _elementType = require("../../constants/element-type");
|
|
@@ -79,11 +79,4 @@ var isTextCommentExist = exports.isTextCommentExist = function isTextCommentExis
|
|
|
79
79
|
return false;
|
|
80
80
|
});
|
|
81
81
|
return comment ? true : false;
|
|
82
|
-
};
|
|
83
|
-
var LEGACY_DEFAULT_TEXT_COLOR = /^(#333333|#333|rgb\(\s*51\s*,\s*51\s*,\s*51\s*\)|rgba\(\s*51\s*,\s*51\s*,\s*51\s*,\s*1\s*\))$/i;
|
|
84
|
-
|
|
85
|
-
// Theme the legacy default color without changing stored document marks.
|
|
86
|
-
var getThemedTextColor = exports.getThemedTextColor = function getThemedTextColor(color) {
|
|
87
|
-
if (typeof color !== 'string' || !LEGACY_DEFAULT_TEXT_COLOR.test(color.trim())) return color;
|
|
88
|
-
return "var(--bs-document-text-color, ".concat(color, ")");
|
|
89
82
|
};
|
|
@@ -22,7 +22,6 @@ var renderText = function renderText(props, editor) {
|
|
|
22
22
|
rest = (0, _objectWithoutProperties2["default"])(leaf, _excluded);
|
|
23
23
|
var markedChildren = /*#__PURE__*/_react["default"].cloneElement(children);
|
|
24
24
|
var style = {};
|
|
25
|
-
var commentHighlightClass = '';
|
|
26
25
|
// The following is a workaround for a Chromium bug where,
|
|
27
26
|
// if you have an inline at the end of a block,
|
|
28
27
|
// clicking the end of a block puts the cursor inside the inline
|
|
@@ -79,27 +78,20 @@ var renderText = function renderText(props, editor) {
|
|
|
79
78
|
// Multi comment or only one comment
|
|
80
79
|
if (commentRest.length > 1) {
|
|
81
80
|
style['backgroundColor'] = 'rgba(129, 237, 247)';
|
|
82
|
-
commentHighlightClass = 'sdoc-comment-highlight-multiple';
|
|
83
81
|
}
|
|
84
82
|
if (commentRest.length === 1) {
|
|
85
83
|
style['backgroundColor'] = 'rgba(129, 237, 247, 0.5)';
|
|
86
|
-
commentHighlightClass = 'sdoc-comment-highlight';
|
|
87
84
|
}
|
|
88
85
|
}
|
|
89
86
|
if (leaf.computed_background_color) {
|
|
90
87
|
style['backgroundColor'] = leaf.computed_background_color;
|
|
91
88
|
}
|
|
92
89
|
if (leaf[_constants.TEXT_STYLE_MAP.COLOR]) {
|
|
93
|
-
style['color'] =
|
|
90
|
+
style['color'] = leaf[_constants.TEXT_STYLE_MAP.COLOR];
|
|
94
91
|
}
|
|
95
92
|
if (leaf[_constants.TEXT_STYLE_MAP.HIGHLIGHT_COLOR]) {
|
|
96
93
|
style['backgroundColor'] = leaf[_constants.TEXT_STYLE_MAP.HIGHLIGHT_COLOR];
|
|
97
94
|
}
|
|
98
|
-
|
|
99
|
-
// Let dark mode restyle comment highlights only when no other background wins.
|
|
100
|
-
if (commentHighlightClass && !leaf.computed_background_color && !leaf[_constants.TEXT_STYLE_MAP.HIGHLIGHT_COLOR]) {
|
|
101
|
-
rest[commentHighlightClass] = true;
|
|
102
|
-
}
|
|
103
95
|
if (leaf[_constants.TEXT_STYLE_MAP.FONT_SIZE]) {
|
|
104
96
|
var fontSize = leaf[_constants.TEXT_STYLE_MAP.FONT_SIZE];
|
|
105
97
|
if (typeof fontSize === 'number') {
|
|
@@ -8,24 +8,24 @@
|
|
|
8
8
|
.video-hover-menu-container .hover-menu-container {
|
|
9
9
|
height: 40px;
|
|
10
10
|
padding: 8px;
|
|
11
|
-
background-color:
|
|
11
|
+
background-color: #fff;
|
|
12
12
|
display: flex;
|
|
13
13
|
justify-content: flex-start;
|
|
14
14
|
align-items: center;
|
|
15
|
-
border: 1px solid
|
|
15
|
+
border: 1px solid #eee;
|
|
16
16
|
border-radius: 8px;
|
|
17
|
-
box-shadow:
|
|
17
|
+
box-shadow: 0 6px 14px 0 rgba(0, 0, 0, 0.10);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.video-hover-menu-container .hover-menu-container>span:not(:last-of-type) {
|
|
21
21
|
padding-right: 8px;
|
|
22
|
-
border-right: 1px solid
|
|
22
|
+
border-right: 1px solid #e5e5e5;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.video-hover-menu-container .hover-menu-container .op-item {
|
|
26
26
|
position: relative;
|
|
27
27
|
font-size: 12px;
|
|
28
|
-
color:
|
|
28
|
+
color: #212529;
|
|
29
29
|
padding: 0 5px;
|
|
30
30
|
border-radius: 2px;
|
|
31
31
|
min-width: 24px;
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
|
|
38
38
|
.video-hover-menu-container .hover-menu-container .op-item:hover {
|
|
39
39
|
text-decoration: none;
|
|
40
|
-
background:
|
|
40
|
+
background: #EFEFEF;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
.video-hover-menu-container .op-group-item:first-child .op-item:last-child,
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
.video-hover-menu-container .hover-menu-container .sdocfont {
|
|
49
49
|
line-height: 1;
|
|
50
50
|
font-size: 14px;
|
|
51
|
-
color:
|
|
51
|
+
color: #666;
|
|
52
52
|
}
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
.sdoc-whiteboard-hover-menu-container .hover-menu-container {
|
|
9
9
|
height: 40px;
|
|
10
10
|
padding: 8px;
|
|
11
|
-
background-color:
|
|
11
|
+
background-color: #fff;
|
|
12
12
|
display: flex;
|
|
13
13
|
justify-content: flex-start;
|
|
14
14
|
align-items: center;
|
|
15
|
-
border: 1px solid
|
|
15
|
+
border: 1px solid #eee;
|
|
16
16
|
border-radius: 8px;
|
|
17
|
-
box-shadow:
|
|
17
|
+
box-shadow: 0 6px 14px 0 rgba(0, 0, 0, 0.10);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.sdoc-whiteboard-hover-menu-container .hover-menu-container>span {
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
|
|
24
24
|
.sdoc-whiteboard-hover-menu-container .hover-menu-container>span:not(:last-of-type) {
|
|
25
25
|
padding: 0 8px;
|
|
26
|
-
border-right: 1px solid
|
|
26
|
+
border-right: 1px solid #e5e5e5;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.sdoc-whiteboard-hover-menu-container .hover-menu-container .op-item {
|
|
30
30
|
position: relative;
|
|
31
31
|
font-size: 12px;
|
|
32
|
-
color:
|
|
32
|
+
color: #212529;
|
|
33
33
|
padding: 0 5px;
|
|
34
34
|
border-radius: 2px;
|
|
35
35
|
min-width: 24px;
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
|
|
42
42
|
.sdoc-whiteboard-hover-menu-container .hover-menu-container .op-item:hover {
|
|
43
43
|
text-decoration: none;
|
|
44
|
-
background:
|
|
44
|
+
background: #EFEFEF;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.sdoc-whiteboard-hover-menu-container .hover-menu-container .sdocfont {
|
|
48
48
|
line-height: 1;
|
|
49
49
|
font-size: 14px;
|
|
50
|
-
color:
|
|
50
|
+
color: #666;
|
|
51
51
|
}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
width: auto;
|
|
5
5
|
height: 42px;
|
|
6
6
|
z-index: 101;
|
|
7
|
-
background-color:
|
|
8
|
-
border: 1px solid
|
|
7
|
+
background-color: #fff;
|
|
8
|
+
border: 1px solid #eee;
|
|
9
9
|
border-radius: 8px;
|
|
10
|
-
box-shadow:
|
|
10
|
+
box-shadow: 0 6px 14px 0 rgba(0, 0, 0, 0.1);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.sdoc-context-toolbar .menu-group {
|