@seafile/sdoc-editor 3.0.257-alpha.3 → 3.0.257-alpha.4
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/assets/css/sdoc-editor-plugins.css +13 -0
- package/dist/comment/components/comment-list.css +2 -1
- package/dist/extension/plugins/callout/render-elem/index.css +5 -0
- package/dist/extension/plugins/callout/render-elem/index.js +3 -0
- package/dist/extension/plugins/table/render/index.css +5 -0
- package/dist/extension/plugins/text-style/render-elem.js +8 -0
- package/package.json +1 -1
|
@@ -372,3 +372,16 @@
|
|
|
372
372
|
padding: 3px 0;
|
|
373
373
|
background-color: #a9c9ed;
|
|
374
374
|
}
|
|
375
|
+
|
|
376
|
+
[data-bs-theme="dark"] .sdoc-editor__article .sdoc-temporary-selection {
|
|
377
|
+
background-color: var(--bs-tr-active-bg);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/* Comment highlights are inline light colors; keep their hue so light text stays readable. */
|
|
381
|
+
[data-bs-theme="dark"] .sdoc-comment-highlight {
|
|
382
|
+
background-color: rgba(129, 237, 247, 0.25) !important;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
[data-bs-theme="dark"] .sdoc-comment-highlight-multiple {
|
|
386
|
+
background-color: rgba(129, 237, 247, 0.4) !important;
|
|
387
|
+
}
|
|
@@ -246,6 +246,7 @@
|
|
|
246
246
|
|
|
247
247
|
[data-bs-theme="dark"] .sdoc-comment-list-container .comment-ui-container .comment-operation {
|
|
248
248
|
color: var(--bs-body-color);
|
|
249
|
+
background-color: transparent;
|
|
249
250
|
}
|
|
250
251
|
|
|
251
252
|
.sdoc-comment-list-container .comment-ui-container.active .comment-operation:hover {
|
|
@@ -254,7 +255,7 @@
|
|
|
254
255
|
}
|
|
255
256
|
|
|
256
257
|
[data-bs-theme="dark"] .sdoc-comment-list-container .comment-ui-container.active .comment-operation:hover {
|
|
257
|
-
background-color: var(--bs-
|
|
258
|
+
background-color: var(--bs-icon-btn-hover-bg-color);
|
|
258
259
|
}
|
|
259
260
|
|
|
260
261
|
.sdoc-comment-menu {
|
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
display: flex;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
/* Recompute inherited text color with the light tokens scoped to filled callouts. */
|
|
15
|
+
.sdoc-callout-container[data-bs-theme="light"] {
|
|
16
|
+
color: var(--bs-body-color);
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
.sdoc-callout-container .callout-content {
|
|
15
20
|
flex: 1;
|
|
16
21
|
position: relative;
|
|
@@ -140,6 +140,9 @@ var renderCallout = function renderCallout(_ref, editor) {
|
|
|
140
140
|
ref: calloutRef,
|
|
141
141
|
className: "sdoc-callout-container",
|
|
142
142
|
style: containerStyle
|
|
143
|
+
// Callout fills are light document colors, so their content keeps light theme colors.
|
|
144
|
+
,
|
|
145
|
+
"data-bs-theme": containerStyle.backgroundColor !== 'transparent' ? 'light' : undefined
|
|
143
146
|
}, element.callout_icon && /*#__PURE__*/_react["default"].createElement("div", {
|
|
144
147
|
className: "callout-icon"
|
|
145
148
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -68,6 +68,11 @@
|
|
|
68
68
|
border-left-color: var(--bs-border-color) !important;
|
|
69
69
|
}
|
|
70
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
|
+
|
|
71
76
|
.sdoc-cell-container {
|
|
72
77
|
width: 100%;
|
|
73
78
|
}
|
|
@@ -22,6 +22,7 @@ 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 = '';
|
|
25
26
|
// The following is a workaround for a Chromium bug where,
|
|
26
27
|
// if you have an inline at the end of a block,
|
|
27
28
|
// clicking the end of a block puts the cursor inside the inline
|
|
@@ -78,9 +79,11 @@ var renderText = function renderText(props, editor) {
|
|
|
78
79
|
// Multi comment or only one comment
|
|
79
80
|
if (commentRest.length > 1) {
|
|
80
81
|
style['backgroundColor'] = 'rgba(129, 237, 247)';
|
|
82
|
+
commentHighlightClass = 'sdoc-comment-highlight-multiple';
|
|
81
83
|
}
|
|
82
84
|
if (commentRest.length === 1) {
|
|
83
85
|
style['backgroundColor'] = 'rgba(129, 237, 247, 0.5)';
|
|
86
|
+
commentHighlightClass = 'sdoc-comment-highlight';
|
|
84
87
|
}
|
|
85
88
|
}
|
|
86
89
|
if (leaf.computed_background_color) {
|
|
@@ -92,6 +95,11 @@ var renderText = function renderText(props, editor) {
|
|
|
92
95
|
if (leaf[_constants.TEXT_STYLE_MAP.HIGHLIGHT_COLOR]) {
|
|
93
96
|
style['backgroundColor'] = leaf[_constants.TEXT_STYLE_MAP.HIGHLIGHT_COLOR];
|
|
94
97
|
}
|
|
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
|
+
}
|
|
95
103
|
if (leaf[_constants.TEXT_STYLE_MAP.FONT_SIZE]) {
|
|
96
104
|
var fontSize = leaf[_constants.TEXT_STYLE_MAP.FONT_SIZE];
|
|
97
105
|
if (typeof fontSize === 'number') {
|