@haklex/rich-plugin-table 0.0.82 → 0.0.83
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/index.mjs +525 -550
- package/dist/rich-plugin-table.css +1 -2
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,567 +1,542 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
1
2
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
2
|
-
import { $
|
|
3
|
-
import { $
|
|
4
|
-
import {
|
|
3
|
+
import { $isTableCellNode, $getTableNodeFromLexicalNodeOrThrow, $insertTableRowAtSelection, $deleteTableRow__EXPERIMENTAL, $deleteTableColumn__EXPERIMENTAL, $getTableCellNodeFromLexicalNode } from "@lexical/table";
|
|
4
|
+
import { $getNearestNodeFromDOMNode, $createRangeSelection, $setSelection } from "lexical";
|
|
5
|
+
import { useState, useRef, useCallback, useEffect } from "react";
|
|
5
6
|
import { createPortal } from "react-dom";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, GripVertical, Plus, Trash2 } from "lucide-react";
|
|
9
|
-
//#region src/styles.css.ts
|
|
7
|
+
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator } from "@haklex/rich-editor-ui";
|
|
8
|
+
import { Plus, GripVertical, ArrowUp, ArrowDown, Trash2, ArrowLeft, ArrowRight } from "lucide-react";
|
|
10
9
|
var menuItemDestructive = "t6ga9o0";
|
|
10
|
+
var resizeHandle = "t6ga9o1";
|
|
11
|
+
var resizeHandleActive = "t6ga9o2";
|
|
11
12
|
var rowColHandle = "t6ga9o3";
|
|
12
13
|
var rowColHandleVisible = "t6ga9o4";
|
|
13
14
|
var handleBtn = "t6ga9o5";
|
|
14
|
-
|
|
15
|
-
//#region src/TableCellResizerPlugin.tsx
|
|
16
|
-
var RESIZER_HANDLE_ATTR = "data-table-resizer-handle";
|
|
15
|
+
const RESIZER_HANDLE_ATTR = "data-table-resizer-handle";
|
|
17
16
|
function TableCellResizerInner({ editor }) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
17
|
+
const [activeCell, setActiveCell] = useState(null);
|
|
18
|
+
const [resizing, setResizing] = useState(false);
|
|
19
|
+
const [direction, setDirection] = useState(null);
|
|
20
|
+
const [handlePos, setHandlePos] = useState({ right: null, bottom: null });
|
|
21
|
+
const startXRef = useRef(0);
|
|
22
|
+
const startYRef = useRef(0);
|
|
23
|
+
const startWidthRef = useRef(0);
|
|
24
|
+
const startHeightRef = useRef(0);
|
|
25
|
+
const cleanupRef = useRef(null);
|
|
26
|
+
const activeCellRef = useRef(null);
|
|
27
|
+
const updateHandlePos = useCallback((cell) => {
|
|
28
|
+
if (!cell) {
|
|
29
|
+
setHandlePos({ right: null, bottom: null });
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const rect = cell.getBoundingClientRect();
|
|
33
|
+
setHandlePos({
|
|
34
|
+
right: {
|
|
35
|
+
top: rect.top,
|
|
36
|
+
left: rect.right - 4,
|
|
37
|
+
height: rect.height
|
|
38
|
+
},
|
|
39
|
+
bottom: {
|
|
40
|
+
top: rect.bottom - 4,
|
|
41
|
+
left: rect.left,
|
|
42
|
+
width: rect.width
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}, []);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
return () => {
|
|
48
|
+
cleanupRef.current?.();
|
|
49
|
+
};
|
|
50
|
+
}, []);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
const rootElement = editor.getRootElement();
|
|
53
|
+
if (!rootElement) return;
|
|
54
|
+
const handleMouseMove = (e) => {
|
|
55
|
+
if (resizing) return;
|
|
56
|
+
const target = e.target;
|
|
57
|
+
const cell = target.closest("td, th");
|
|
58
|
+
if (cell && rootElement.contains(cell)) {
|
|
59
|
+
activeCellRef.current = cell;
|
|
60
|
+
setActiveCell(cell);
|
|
61
|
+
updateHandlePos(cell);
|
|
62
|
+
} else {
|
|
63
|
+
activeCellRef.current = null;
|
|
64
|
+
setActiveCell(null);
|
|
65
|
+
updateHandlePos(null);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const handleMouseLeave = (e) => {
|
|
69
|
+
const related = e.relatedTarget;
|
|
70
|
+
if (related?.closest?.(`[${RESIZER_HANDLE_ATTR}="true"]`)) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (!resizing) {
|
|
74
|
+
activeCellRef.current = null;
|
|
75
|
+
setActiveCell(null);
|
|
76
|
+
updateHandlePos(null);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
rootElement.addEventListener("mousemove", handleMouseMove);
|
|
80
|
+
rootElement.addEventListener("mouseleave", handleMouseLeave);
|
|
81
|
+
return () => {
|
|
82
|
+
rootElement.removeEventListener("mousemove", handleMouseMove);
|
|
83
|
+
rootElement.removeEventListener("mouseleave", handleMouseLeave);
|
|
84
|
+
};
|
|
85
|
+
}, [editor, resizing, updateHandlePos]);
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
if (!activeCell || resizing) return;
|
|
88
|
+
const onViewportChange = () => {
|
|
89
|
+
updateHandlePos(activeCellRef.current);
|
|
90
|
+
};
|
|
91
|
+
window.addEventListener("scroll", onViewportChange, true);
|
|
92
|
+
window.addEventListener("resize", onViewportChange);
|
|
93
|
+
return () => {
|
|
94
|
+
window.removeEventListener("scroll", onViewportChange, true);
|
|
95
|
+
window.removeEventListener("resize", onViewportChange);
|
|
96
|
+
};
|
|
97
|
+
}, [activeCell, resizing, updateHandlePos]);
|
|
98
|
+
const onPointerDown = useCallback(
|
|
99
|
+
(dir, e) => {
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
e.stopPropagation();
|
|
102
|
+
if (!activeCell) return;
|
|
103
|
+
setResizing(true);
|
|
104
|
+
setDirection(dir);
|
|
105
|
+
startXRef.current = e.clientX;
|
|
106
|
+
startYRef.current = e.clientY;
|
|
107
|
+
startWidthRef.current = activeCell.offsetWidth;
|
|
108
|
+
startHeightRef.current = activeCell.offsetHeight;
|
|
109
|
+
const capturedCell = activeCell;
|
|
110
|
+
const onPointerMove = (ev) => {
|
|
111
|
+
if (dir === "right") {
|
|
112
|
+
const diff = ev.clientX - startXRef.current;
|
|
113
|
+
const newWidth = Math.max(50, startWidthRef.current + diff);
|
|
114
|
+
const colIndex = capturedCell.cellIndex;
|
|
115
|
+
const table = capturedCell.closest("table");
|
|
116
|
+
if (table) {
|
|
117
|
+
const allRows = table.querySelectorAll("tr");
|
|
118
|
+
allRows.forEach((row) => {
|
|
119
|
+
const cells = row.querySelectorAll("td, th");
|
|
120
|
+
if (cells[colIndex]) {
|
|
121
|
+
cells[colIndex].style.width = `${newWidth}px`;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
updateHandlePos(capturedCell);
|
|
125
|
+
}
|
|
126
|
+
} else {
|
|
127
|
+
const diff = ev.clientY - startYRef.current;
|
|
128
|
+
const newHeight = Math.max(30, startHeightRef.current + diff);
|
|
129
|
+
const row = capturedCell.parentElement;
|
|
130
|
+
if (row) {
|
|
131
|
+
row.style.height = `${newHeight}px`;
|
|
132
|
+
updateHandlePos(capturedCell);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const cleanup = () => {
|
|
137
|
+
document.removeEventListener("pointermove", onPointerMove);
|
|
138
|
+
document.removeEventListener("pointerup", onPointerUp);
|
|
139
|
+
cleanupRef.current = null;
|
|
140
|
+
};
|
|
141
|
+
const onPointerUp = (ev) => {
|
|
142
|
+
cleanup();
|
|
143
|
+
setResizing(false);
|
|
144
|
+
setDirection(null);
|
|
145
|
+
if (dir === "right") {
|
|
146
|
+
const diff = ev.clientX - startXRef.current;
|
|
147
|
+
const newWidth = Math.max(50, startWidthRef.current + diff);
|
|
148
|
+
editor.update(() => {
|
|
149
|
+
const node = $getNearestNodeFromDOMNode(capturedCell);
|
|
150
|
+
if (node && $isTableCellNode(node)) {
|
|
151
|
+
node.setWidth(newWidth);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
} else {
|
|
155
|
+
const diff = ev.clientY - startYRef.current;
|
|
156
|
+
const newHeight = Math.max(30, startHeightRef.current + diff);
|
|
157
|
+
editor.update(() => {
|
|
158
|
+
const node = $getNearestNodeFromDOMNode(capturedCell);
|
|
159
|
+
if (node && $isTableCellNode(node)) {
|
|
160
|
+
$getTableNodeFromLexicalNodeOrThrow(node);
|
|
161
|
+
const row = node.getParent();
|
|
162
|
+
if (row) {
|
|
163
|
+
const rowDOM = editor.getElementByKey(row.getKey());
|
|
164
|
+
if (rowDOM) {
|
|
165
|
+
rowDOM.style.height = `${newHeight}px`;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
cleanupRef.current = cleanup;
|
|
173
|
+
document.addEventListener("pointermove", onPointerMove);
|
|
174
|
+
document.addEventListener("pointerup", onPointerUp);
|
|
175
|
+
},
|
|
176
|
+
[activeCell, editor, updateHandlePos]
|
|
177
|
+
);
|
|
178
|
+
if (!activeCell) return null;
|
|
179
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
180
|
+
handlePos.right && /* @__PURE__ */ jsx(
|
|
181
|
+
"div",
|
|
182
|
+
{
|
|
183
|
+
className: `${resizeHandle} ${direction === "right" ? resizeHandleActive : ""}`,
|
|
184
|
+
"data-table-resizer-handle": "true",
|
|
185
|
+
"data-testid": "table-cell-resizer-right",
|
|
186
|
+
style: {
|
|
187
|
+
top: handlePos.right.top,
|
|
188
|
+
left: handlePos.right.left,
|
|
189
|
+
height: handlePos.right.height,
|
|
190
|
+
width: 8,
|
|
191
|
+
cursor: "col-resize",
|
|
192
|
+
background: direction === "right" ? "linear-gradient(to right, transparent 3px, rgba(59,130,246,0.7) 3px, rgba(59,130,246,0.7) 5px, transparent 5px)" : "linear-gradient(to right, transparent 3px, rgba(59,130,246,0.5) 3px, rgba(59,130,246,0.5) 5px, transparent 5px)"
|
|
193
|
+
},
|
|
194
|
+
onPointerDown: (e) => onPointerDown("right", e)
|
|
195
|
+
}
|
|
196
|
+
),
|
|
197
|
+
handlePos.bottom && /* @__PURE__ */ jsx(
|
|
198
|
+
"div",
|
|
199
|
+
{
|
|
200
|
+
className: `${resizeHandle} ${direction === "bottom" ? resizeHandleActive : ""}`,
|
|
201
|
+
"data-table-resizer-handle": "true",
|
|
202
|
+
"data-testid": "table-cell-resizer-bottom",
|
|
203
|
+
style: {
|
|
204
|
+
top: handlePos.bottom.top,
|
|
205
|
+
left: handlePos.bottom.left,
|
|
206
|
+
width: handlePos.bottom.width,
|
|
207
|
+
height: 8,
|
|
208
|
+
cursor: "row-resize",
|
|
209
|
+
background: direction === "bottom" ? "linear-gradient(to bottom, transparent 3px, rgba(59,130,246,0.7) 3px, rgba(59,130,246,0.7) 5px, transparent 5px)" : "linear-gradient(to bottom, transparent 3px, rgba(59,130,246,0.5) 3px, rgba(59,130,246,0.5) 5px, transparent 5px)"
|
|
210
|
+
},
|
|
211
|
+
onPointerDown: (e) => onPointerDown("bottom", e)
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
] });
|
|
211
215
|
}
|
|
212
216
|
function TableCellResizerPlugin() {
|
|
213
|
-
|
|
214
|
-
|
|
217
|
+
const [editor] = useLexicalComposerContext();
|
|
218
|
+
return createPortal(/* @__PURE__ */ jsx(TableCellResizerInner, { editor }), document.body);
|
|
215
219
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
var ROW_HANDLE_HEIGHT = 16;
|
|
221
|
-
var COL_HANDLE_WIDTH = 34;
|
|
220
|
+
const HIDE_DELAY = 300;
|
|
221
|
+
const ICON_SIZE = 12;
|
|
222
|
+
const ROW_HANDLE_HEIGHT = 16;
|
|
223
|
+
const COL_HANDLE_WIDTH = 34;
|
|
222
224
|
function toPagePosition(rect) {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
225
|
+
return {
|
|
226
|
+
top: rect.top + window.scrollY,
|
|
227
|
+
left: rect.left + window.scrollX
|
|
228
|
+
};
|
|
227
229
|
}
|
|
228
230
|
function selectCellAtIndex(table, rowIdx, colIdx, editor) {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
231
|
+
const rows = table.querySelectorAll("tr");
|
|
232
|
+
const targetRow = rows[rowIdx];
|
|
233
|
+
if (!targetRow) return;
|
|
234
|
+
const cells = targetRow.querySelectorAll("td, th");
|
|
235
|
+
const targetCell = cells[colIdx] ?? cells[0];
|
|
236
|
+
if (!targetCell) return;
|
|
237
|
+
editor.update(() => {
|
|
238
|
+
const node = $getNearestNodeFromDOMNode(targetCell);
|
|
239
|
+
if (!node) return;
|
|
240
|
+
const cellNode = $getTableCellNodeFromLexicalNode(node);
|
|
241
|
+
if (!cellNode || !$isTableCellNode(cellNode)) return;
|
|
242
|
+
const firstChild = cellNode.getFirstChild();
|
|
243
|
+
if (firstChild) {
|
|
244
|
+
const sel = $createRangeSelection();
|
|
245
|
+
sel.anchor.set(firstChild.getKey(), 0, "element");
|
|
246
|
+
sel.focus.set(firstChild.getKey(), 0, "element");
|
|
247
|
+
$setSelection(sel);
|
|
248
|
+
}
|
|
249
|
+
});
|
|
247
250
|
}
|
|
248
|
-
function TableRowColumnHandlesInner({
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
"aria-label": "Add column",
|
|
532
|
-
className: handleBtn,
|
|
533
|
-
type: "button",
|
|
534
|
-
onClick: addColumnLeft,
|
|
535
|
-
children: /* @__PURE__ */ jsx(Plus, { size: ICON_SIZE })
|
|
536
|
-
}), /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
537
|
-
className: handleBtn,
|
|
538
|
-
children: /* @__PURE__ */ jsx(GripVertical, { size: ICON_SIZE })
|
|
539
|
-
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
540
|
-
align: "start",
|
|
541
|
-
side: "bottom",
|
|
542
|
-
sideOffset: 4,
|
|
543
|
-
children: [
|
|
544
|
-
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
545
|
-
onClick: insertColumnLeft,
|
|
546
|
-
children: [/* @__PURE__ */ jsx(ArrowLeft, { size: 14 }), "Insert column left"]
|
|
547
|
-
}),
|
|
548
|
-
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
549
|
-
onClick: insertColumnRight,
|
|
550
|
-
children: [/* @__PURE__ */ jsx(ArrowRight, { size: 14 }), "Insert column right"]
|
|
551
|
-
}),
|
|
552
|
-
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
553
|
-
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
554
|
-
className: menuItemDestructive,
|
|
555
|
-
onClick: deleteColumn,
|
|
556
|
-
children: [/* @__PURE__ */ jsx(Trash2, { size: 14 }), "Delete column"]
|
|
557
|
-
})
|
|
558
|
-
]
|
|
559
|
-
})] })]
|
|
560
|
-
})] });
|
|
251
|
+
function TableRowColumnHandlesInner({
|
|
252
|
+
editor
|
|
253
|
+
}) {
|
|
254
|
+
const [rowHandle, setRowHandle] = useState({
|
|
255
|
+
visible: false,
|
|
256
|
+
top: 0,
|
|
257
|
+
left: 0,
|
|
258
|
+
rowIndex: 0,
|
|
259
|
+
colIndex: 0
|
|
260
|
+
});
|
|
261
|
+
const [colHandle, setColHandle] = useState({
|
|
262
|
+
visible: false,
|
|
263
|
+
top: 0,
|
|
264
|
+
left: 0,
|
|
265
|
+
rowIndex: 0,
|
|
266
|
+
colIndex: 0
|
|
267
|
+
});
|
|
268
|
+
const tableRef = useRef(null);
|
|
269
|
+
const hideTimerRef = useRef(null);
|
|
270
|
+
const hoveringHandleRef = useRef(false);
|
|
271
|
+
const activeAnchorRef = useRef(null);
|
|
272
|
+
const clearHideTimer = useCallback(() => {
|
|
273
|
+
if (hideTimerRef.current) {
|
|
274
|
+
clearTimeout(hideTimerRef.current);
|
|
275
|
+
hideTimerRef.current = null;
|
|
276
|
+
}
|
|
277
|
+
}, []);
|
|
278
|
+
const scheduleHide = useCallback(() => {
|
|
279
|
+
clearHideTimer();
|
|
280
|
+
hideTimerRef.current = setTimeout(() => {
|
|
281
|
+
if (!hoveringHandleRef.current) {
|
|
282
|
+
activeAnchorRef.current = null;
|
|
283
|
+
setRowHandle((s) => ({ ...s, visible: false }));
|
|
284
|
+
setColHandle((s) => ({ ...s, visible: false }));
|
|
285
|
+
}
|
|
286
|
+
}, HIDE_DELAY);
|
|
287
|
+
}, [clearHideTimer]);
|
|
288
|
+
const handleEnter = useCallback(() => {
|
|
289
|
+
hoveringHandleRef.current = true;
|
|
290
|
+
clearHideTimer();
|
|
291
|
+
}, [clearHideTimer]);
|
|
292
|
+
const handleLeave = useCallback(() => {
|
|
293
|
+
hoveringHandleRef.current = false;
|
|
294
|
+
scheduleHide();
|
|
295
|
+
}, [scheduleHide]);
|
|
296
|
+
const updateHandlesFromAnchor = useCallback((anchor) => {
|
|
297
|
+
if (anchor !== void 0) {
|
|
298
|
+
activeAnchorRef.current = anchor;
|
|
299
|
+
}
|
|
300
|
+
const activeAnchor = activeAnchorRef.current;
|
|
301
|
+
if (!activeAnchor) return;
|
|
302
|
+
const { table, rowIndex, colIndex } = activeAnchor;
|
|
303
|
+
if (!table.isConnected) {
|
|
304
|
+
activeAnchorRef.current = null;
|
|
305
|
+
setRowHandle((s) => ({ ...s, visible: false }));
|
|
306
|
+
setColHandle((s) => ({ ...s, visible: false }));
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
const rows = table.querySelectorAll("tr");
|
|
310
|
+
const row = rows[rowIndex];
|
|
311
|
+
if (!row) {
|
|
312
|
+
activeAnchorRef.current = null;
|
|
313
|
+
setRowHandle((s) => ({ ...s, visible: false }));
|
|
314
|
+
setColHandle((s) => ({ ...s, visible: false }));
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
const cells = row.querySelectorAll("td, th");
|
|
318
|
+
const cell = cells[colIndex] ?? cells[0];
|
|
319
|
+
if (!cell) {
|
|
320
|
+
activeAnchorRef.current = null;
|
|
321
|
+
setRowHandle((s) => ({ ...s, visible: false }));
|
|
322
|
+
setColHandle((s) => ({ ...s, visible: false }));
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
tableRef.current = table;
|
|
326
|
+
const resolvedColIndex = cell.cellIndex;
|
|
327
|
+
activeAnchorRef.current = { table, rowIndex, colIndex: resolvedColIndex };
|
|
328
|
+
const cellRect = cell.getBoundingClientRect();
|
|
329
|
+
const tableRect = table.getBoundingClientRect();
|
|
330
|
+
const cellPage = toPagePosition(cellRect);
|
|
331
|
+
const tablePage = toPagePosition(tableRect);
|
|
332
|
+
setRowHandle({
|
|
333
|
+
visible: true,
|
|
334
|
+
top: cellPage.top + cellRect.height / 2 - ROW_HANDLE_HEIGHT / 2,
|
|
335
|
+
left: tablePage.left - 38,
|
|
336
|
+
rowIndex,
|
|
337
|
+
colIndex: resolvedColIndex
|
|
338
|
+
});
|
|
339
|
+
setColHandle({
|
|
340
|
+
visible: true,
|
|
341
|
+
top: tablePage.top - 22,
|
|
342
|
+
left: cellPage.left + cellRect.width / 2 - COL_HANDLE_WIDTH / 2,
|
|
343
|
+
rowIndex,
|
|
344
|
+
colIndex: resolvedColIndex
|
|
345
|
+
});
|
|
346
|
+
}, []);
|
|
347
|
+
useEffect(() => {
|
|
348
|
+
const rootElement = editor.getRootElement();
|
|
349
|
+
if (!rootElement) return;
|
|
350
|
+
const onMouseMove = (e) => {
|
|
351
|
+
const target = e.target;
|
|
352
|
+
const cell = target.closest("td, th");
|
|
353
|
+
const table = target.closest("table");
|
|
354
|
+
if (!cell || !table || !rootElement.contains(table)) {
|
|
355
|
+
if (!hoveringHandleRef.current) {
|
|
356
|
+
scheduleHide();
|
|
357
|
+
}
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
clearHideTimer();
|
|
361
|
+
const rowEl = cell.parentElement;
|
|
362
|
+
const rowIdx = rowEl ? rowEl.rowIndex : 0;
|
|
363
|
+
const colIdx = cell.cellIndex;
|
|
364
|
+
updateHandlesFromAnchor({
|
|
365
|
+
table,
|
|
366
|
+
rowIndex: rowIdx,
|
|
367
|
+
colIndex: colIdx
|
|
368
|
+
});
|
|
369
|
+
};
|
|
370
|
+
const onMouseLeave = () => {
|
|
371
|
+
if (!hoveringHandleRef.current) {
|
|
372
|
+
scheduleHide();
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
rootElement.addEventListener("mousemove", onMouseMove);
|
|
376
|
+
rootElement.addEventListener("mouseleave", onMouseLeave);
|
|
377
|
+
return () => {
|
|
378
|
+
rootElement.removeEventListener("mousemove", onMouseMove);
|
|
379
|
+
rootElement.removeEventListener("mouseleave", onMouseLeave);
|
|
380
|
+
clearHideTimer();
|
|
381
|
+
};
|
|
382
|
+
}, [editor, scheduleHide, clearHideTimer, updateHandlesFromAnchor]);
|
|
383
|
+
useEffect(() => {
|
|
384
|
+
const onViewportChange = () => {
|
|
385
|
+
updateHandlesFromAnchor();
|
|
386
|
+
};
|
|
387
|
+
window.addEventListener("scroll", onViewportChange, true);
|
|
388
|
+
window.addEventListener("resize", onViewportChange);
|
|
389
|
+
return () => {
|
|
390
|
+
window.removeEventListener("scroll", onViewportChange, true);
|
|
391
|
+
window.removeEventListener("resize", onViewportChange);
|
|
392
|
+
};
|
|
393
|
+
}, [updateHandlesFromAnchor]);
|
|
394
|
+
useEffect(() => {
|
|
395
|
+
return editor.registerUpdateListener(() => {
|
|
396
|
+
updateHandlesFromAnchor();
|
|
397
|
+
});
|
|
398
|
+
}, [editor, updateHandlesFromAnchor]);
|
|
399
|
+
const insertRowAbove = useCallback(() => {
|
|
400
|
+
const table = tableRef.current;
|
|
401
|
+
if (!table) return;
|
|
402
|
+
selectCellAtIndex(table, rowHandle.rowIndex, 0, editor);
|
|
403
|
+
editor.update(() => {
|
|
404
|
+
$insertTableRowAtSelection(false);
|
|
405
|
+
});
|
|
406
|
+
}, [editor, rowHandle.rowIndex]);
|
|
407
|
+
const insertRowBelow = useCallback(() => {
|
|
408
|
+
const table = tableRef.current;
|
|
409
|
+
if (!table) return;
|
|
410
|
+
selectCellAtIndex(table, rowHandle.rowIndex, 0, editor);
|
|
411
|
+
editor.update(() => {
|
|
412
|
+
$insertTableRowAtSelection(true);
|
|
413
|
+
});
|
|
414
|
+
}, [editor, rowHandle.rowIndex]);
|
|
415
|
+
const deleteRow = useCallback(() => {
|
|
416
|
+
const table = tableRef.current;
|
|
417
|
+
if (!table) return;
|
|
418
|
+
selectCellAtIndex(table, rowHandle.rowIndex, 0, editor);
|
|
419
|
+
editor.update(() => {
|
|
420
|
+
$deleteTableRow__EXPERIMENTAL();
|
|
421
|
+
});
|
|
422
|
+
}, [editor, rowHandle.rowIndex]);
|
|
423
|
+
const insertColumnLeft = useCallback(() => {
|
|
424
|
+
const table = tableRef.current;
|
|
425
|
+
if (!table) return;
|
|
426
|
+
selectCellAtIndex(table, 0, colHandle.colIndex, editor);
|
|
427
|
+
editor.update(() => {
|
|
428
|
+
$insertTableRowAtSelection(false);
|
|
429
|
+
});
|
|
430
|
+
}, [editor, colHandle.colIndex]);
|
|
431
|
+
const insertColumnRight = useCallback(() => {
|
|
432
|
+
const table = tableRef.current;
|
|
433
|
+
if (!table) return;
|
|
434
|
+
selectCellAtIndex(table, 0, colHandle.colIndex, editor);
|
|
435
|
+
editor.update(() => {
|
|
436
|
+
$insertTableRowAtSelection(true);
|
|
437
|
+
});
|
|
438
|
+
}, [editor, colHandle.colIndex]);
|
|
439
|
+
const deleteColumn = useCallback(() => {
|
|
440
|
+
const table = tableRef.current;
|
|
441
|
+
if (!table) return;
|
|
442
|
+
selectCellAtIndex(table, 0, colHandle.colIndex, editor);
|
|
443
|
+
editor.update(() => {
|
|
444
|
+
$deleteTableColumn__EXPERIMENTAL();
|
|
445
|
+
});
|
|
446
|
+
}, [editor, colHandle.colIndex]);
|
|
447
|
+
const addRowBelow = useCallback(() => {
|
|
448
|
+
const table = tableRef.current;
|
|
449
|
+
if (!table) return;
|
|
450
|
+
selectCellAtIndex(table, rowHandle.rowIndex, 0, editor);
|
|
451
|
+
editor.update(() => {
|
|
452
|
+
$insertTableRowAtSelection(true);
|
|
453
|
+
});
|
|
454
|
+
}, [editor, rowHandle.rowIndex]);
|
|
455
|
+
const addColumnLeft = useCallback(() => {
|
|
456
|
+
const table = tableRef.current;
|
|
457
|
+
if (!table) return;
|
|
458
|
+
selectCellAtIndex(table, 0, colHandle.colIndex, editor);
|
|
459
|
+
editor.update(() => {
|
|
460
|
+
$insertTableRowAtSelection(false);
|
|
461
|
+
});
|
|
462
|
+
}, [editor, colHandle.colIndex]);
|
|
463
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
464
|
+
/* @__PURE__ */ jsxs(
|
|
465
|
+
"div",
|
|
466
|
+
{
|
|
467
|
+
className: `${rowColHandle} ${rowHandle.visible ? rowColHandleVisible : ""}`,
|
|
468
|
+
style: { top: rowHandle.top, left: rowHandle.left },
|
|
469
|
+
onMouseEnter: handleEnter,
|
|
470
|
+
onMouseLeave: handleLeave,
|
|
471
|
+
children: [
|
|
472
|
+
/* @__PURE__ */ jsx("button", { "aria-label": "Add row", className: handleBtn, type: "button", onClick: addRowBelow, children: /* @__PURE__ */ jsx(Plus, { size: ICON_SIZE }) }),
|
|
473
|
+
/* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
474
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { className: handleBtn, children: /* @__PURE__ */ jsx(GripVertical, { size: ICON_SIZE }) }),
|
|
475
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", side: "right", sideOffset: 4, children: [
|
|
476
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: insertRowAbove, children: [
|
|
477
|
+
/* @__PURE__ */ jsx(ArrowUp, { size: 14 }),
|
|
478
|
+
"Insert row above"
|
|
479
|
+
] }),
|
|
480
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: insertRowBelow, children: [
|
|
481
|
+
/* @__PURE__ */ jsx(ArrowDown, { size: 14 }),
|
|
482
|
+
"Insert row below"
|
|
483
|
+
] }),
|
|
484
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
485
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { className: menuItemDestructive, onClick: deleteRow, children: [
|
|
486
|
+
/* @__PURE__ */ jsx(Trash2, { size: 14 }),
|
|
487
|
+
"Delete row"
|
|
488
|
+
] })
|
|
489
|
+
] })
|
|
490
|
+
] })
|
|
491
|
+
]
|
|
492
|
+
}
|
|
493
|
+
),
|
|
494
|
+
/* @__PURE__ */ jsxs(
|
|
495
|
+
"div",
|
|
496
|
+
{
|
|
497
|
+
className: `${rowColHandle} ${colHandle.visible ? rowColHandleVisible : ""}`,
|
|
498
|
+
style: { top: colHandle.top, left: colHandle.left },
|
|
499
|
+
onMouseEnter: handleEnter,
|
|
500
|
+
onMouseLeave: handleLeave,
|
|
501
|
+
children: [
|
|
502
|
+
/* @__PURE__ */ jsx(
|
|
503
|
+
"button",
|
|
504
|
+
{
|
|
505
|
+
"aria-label": "Add column",
|
|
506
|
+
className: handleBtn,
|
|
507
|
+
type: "button",
|
|
508
|
+
onClick: addColumnLeft,
|
|
509
|
+
children: /* @__PURE__ */ jsx(Plus, { size: ICON_SIZE })
|
|
510
|
+
}
|
|
511
|
+
),
|
|
512
|
+
/* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
513
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { className: handleBtn, children: /* @__PURE__ */ jsx(GripVertical, { size: ICON_SIZE }) }),
|
|
514
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", side: "bottom", sideOffset: 4, children: [
|
|
515
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: insertColumnLeft, children: [
|
|
516
|
+
/* @__PURE__ */ jsx(ArrowLeft, { size: 14 }),
|
|
517
|
+
"Insert column left"
|
|
518
|
+
] }),
|
|
519
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: insertColumnRight, children: [
|
|
520
|
+
/* @__PURE__ */ jsx(ArrowRight, { size: 14 }),
|
|
521
|
+
"Insert column right"
|
|
522
|
+
] }),
|
|
523
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
524
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { className: menuItemDestructive, onClick: deleteColumn, children: [
|
|
525
|
+
/* @__PURE__ */ jsx(Trash2, { size: 14 }),
|
|
526
|
+
"Delete column"
|
|
527
|
+
] })
|
|
528
|
+
] })
|
|
529
|
+
] })
|
|
530
|
+
]
|
|
531
|
+
}
|
|
532
|
+
)
|
|
533
|
+
] });
|
|
561
534
|
}
|
|
562
535
|
function TableRowColumnHandlesPlugin() {
|
|
563
|
-
|
|
564
|
-
|
|
536
|
+
const [editor] = useLexicalComposerContext();
|
|
537
|
+
return createPortal(/* @__PURE__ */ jsx(TableRowColumnHandlesInner, { editor }), document.body);
|
|
565
538
|
}
|
|
566
|
-
|
|
567
|
-
|
|
539
|
+
export {
|
|
540
|
+
TableCellResizerPlugin,
|
|
541
|
+
TableRowColumnHandlesPlugin
|
|
542
|
+
};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
:root{--rc-text:#000;--rc-text-secondary:#27272a;--rc-text-tertiary:#71717a;--rc-text-quaternary:#a1a1aa;--rc-bg:#fff;--rc-bg-secondary:#fafafa;--rc-bg-tertiary:#f4f4f5;--rc-fill:#e8e8ec;--rc-fill-secondary:#eeeeef;--rc-fill-tertiary:#f4f4f6;--rc-fill-quaternary:#f9f9fa;--rc-border:#f4f4f5;--rc-accent:#2563eb;--rc-accent-light:#2563eb20;--rc-link:#2563eb;--rc-code-text:#3f3f46;--rc-code-bg:#f4f4f5;--rc-hr-border:#e4e4e7;--rc-quote-border:#2563eb;--rc-quote-bg:#eff6ff;--rc-alert-info:#006bb7;--rc-alert-warning:#c50;--rc-alert-tip:#1c0;--rc-alert-caution:#c01;--rc-alert-important:#50c;--rc-max-width:700px;--rc-shadow-top-bar:0 8px 30px #0000001f, 0 2px 8px #0000000f;--rc-shadow-modal:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--rc-shadow-menu:0 1px 4px #0000000a, 0 4px 16px #00000014;--rc-space-xs:4px;--rc-space-sm:8px;--rc-space-md:16px;--rc-space-lg:24px;--rc-space-xl:32px;--rc-font-family-sans:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif:"Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono:"SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs:.625em;--rc-font-size-xs:.75em;--rc-font-size-sm:.8125em;--rc-font-size-md:.875em;--rc-font-size-lg:1.25em;--rc-font-size-base:16px;--rc-font-size-small:14px;--rc-line-height:1.7;--rc-line-height-tight:1.4;--rc-font-family:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm:4px;--rc-radius-md:8px;--rc-radius-lg:12px}:root.dark{--rc-text:#fafafa;--rc-text-secondary:#a1a1aa;--rc-text-tertiary:#71717a;--rc-text-quaternary:#52525b;--rc-bg:#09090b;--rc-bg-secondary:#18181b;--rc-bg-tertiary:#27272a;--rc-fill:#2a2a2f;--rc-fill-secondary:#222226;--rc-fill-tertiary:#1b1b1f;--rc-fill-quaternary:#131316;--rc-border:#27272a;--rc-accent:#60a5fa;--rc-accent-light:#60a5fa20;--rc-link:#60a5fa;--rc-code-text:#e4e4e7;--rc-code-bg:#27272a;--rc-hr-border:#27272a;--rc-quote-border:#60a5fa;--rc-quote-bg:#1e3a5f;--rc-alert-info:#7db9e5;--rc-alert-warning:#da864a;--rc-alert-tip:#54da48;--rc-alert-caution:#e16973;--rc-alert-important:#9966e0;--rc-max-width:700px;--rc-shadow-top-bar:0 8px 30px #00000073, 0 2px 8px #0000004d;--rc-shadow-modal:0 10px 15px -3px #0006, 0 4px 6px -4px #00000059;--rc-shadow-menu:0 1px 4px #00000040, 0 4px 16px #0006;--rc-space-xs:4px;--rc-space-sm:8px;--rc-space-md:16px;--rc-space-lg:24px;--rc-space-xl:32px;--rc-font-family-sans:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif:"Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono:"SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs:.625em;--rc-font-size-xs:.75em;--rc-font-size-sm:.8125em;--rc-font-size-md:.875em;--rc-font-size-lg:1.25em;--rc-font-size-base:16px;--rc-font-size-small:14px;--rc-line-height:1.7;--rc-line-height-tight:1.4;--rc-font-family:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm:4px;--rc-radius-md:8px;--rc-radius-lg:12px}.gd62m00{--rc-text:#000;--rc-text-secondary:#27272a;--rc-text-tertiary:#71717a;--rc-text-quaternary:#a1a1aa;--rc-bg:#fff;--rc-bg-secondary:#fafafa;--rc-bg-tertiary:#f4f4f5;--rc-fill:#e8e8ec;--rc-fill-secondary:#eeeeef;--rc-fill-tertiary:#f4f4f6;--rc-fill-quaternary:#f9f9fa;--rc-border:#f4f4f5;--rc-accent:#2563eb;--rc-accent-light:#2563eb20;--rc-link:#2563eb;--rc-code-text:#3f3f46;--rc-code-bg:#f4f4f5;--rc-hr-border:#e4e4e7;--rc-quote-border:#2563eb;--rc-quote-bg:#eff6ff;--rc-alert-info:#006bb7;--rc-alert-warning:#c50;--rc-alert-tip:#1c0;--rc-alert-caution:#c01;--rc-alert-important:#50c;--rc-max-width:700px;--rc-shadow-top-bar:0 8px 30px #0000001f, 0 2px 8px #0000000f;--rc-shadow-modal:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--rc-shadow-menu:0 1px 4px #0000000a, 0 4px 16px #00000014;--rc-space-xs:4px;--rc-space-sm:8px;--rc-space-md:16px;--rc-space-lg:24px;--rc-space-xl:32px;--rc-font-family-sans:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif:"Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono:"SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs:.625em;--rc-font-size-xs:.75em;--rc-font-size-sm:.8125em;--rc-font-size-md:.875em;--rc-font-size-lg:1.25em;--rc-font-size-base:16px;--rc-font-size-small:14px;--rc-line-height:1.7;--rc-line-height-tight:1.4;--rc-font-family:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm:4px;--rc-radius-md:8px;--rc-radius-lg:12px}.gd62m01{--rc-text:#000;--rc-text-secondary:#27272a;--rc-text-tertiary:#71717a;--rc-text-quaternary:#a1a1aa;--rc-bg:#fff;--rc-bg-secondary:#fafafa;--rc-bg-tertiary:#f4f4f5;--rc-fill:#e8e8ec;--rc-fill-secondary:#eeeeef;--rc-fill-tertiary:#f4f4f6;--rc-fill-quaternary:#f9f9fa;--rc-border:#f4f4f5;--rc-accent:#2563eb;--rc-accent-light:#2563eb20;--rc-link:#2563eb;--rc-code-text:#3f3f46;--rc-code-bg:#f4f4f5;--rc-hr-border:#e4e4e7;--rc-quote-border:#2563eb;--rc-quote-bg:#eff6ff;--rc-alert-info:#006bb7;--rc-alert-warning:#c50;--rc-alert-tip:#1c0;--rc-alert-caution:#c01;--rc-alert-important:#50c;--rc-max-width:700px;--rc-shadow-top-bar:0 8px 30px #0000001f, 0 2px 8px #0000000f;--rc-shadow-modal:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--rc-shadow-menu:0 1px 4px #0000000a, 0 4px 16px #00000014;--rc-space-xs:4px;--rc-space-sm:8px;--rc-space-md:16px;--rc-space-lg:24px;--rc-space-xl:32px;--rc-font-family-sans:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif:"Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono:"SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs:.625em;--rc-font-size-xs:.75em;--rc-font-size-sm:.8125em;--rc-font-size-md:.875em;--rc-font-size-lg:1.25em;--rc-font-size-base:16px;--rc-font-size-small:14px;--rc-line-height:1.8;--rc-line-height-tight:1.4;--rc-font-family:"Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-radius-sm:4px;--rc-radius-md:8px;--rc-radius-lg:12px}.gd62m02{--rc-text:#000;--rc-text-secondary:#27272a;--rc-text-tertiary:#71717a;--rc-text-quaternary:#a1a1aa;--rc-bg:#fff;--rc-bg-secondary:#fafafa;--rc-bg-tertiary:#f4f4f5;--rc-fill:#e8e8ec;--rc-fill-secondary:#eeeeef;--rc-fill-tertiary:#f4f4f6;--rc-fill-quaternary:#f9f9fa;--rc-border:#f4f4f5;--rc-accent:#2563eb;--rc-accent-light:#2563eb20;--rc-link:#2563eb;--rc-code-text:#3f3f46;--rc-code-bg:#f4f4f5;--rc-hr-border:#e4e4e7;--rc-quote-border:#a1a1aa;--rc-quote-bg:#fafafa;--rc-alert-info:#006bb7;--rc-alert-warning:#c50;--rc-alert-tip:#1c0;--rc-alert-caution:#c01;--rc-alert-important:#50c;--rc-max-width:none;--rc-shadow-top-bar:0 8px 30px #0000001f, 0 2px 8px #0000000f;--rc-shadow-modal:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--rc-shadow-menu:0 1px 4px #0000000a, 0 4px 16px #00000014;--rc-space-xs:2px;--rc-space-sm:4px;--rc-space-md:10px;--rc-space-lg:16px;--rc-space-xl:20px;--rc-font-family-sans:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif:"Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono:"SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs:.625em;--rc-font-size-xs:.75em;--rc-font-size-sm:.8125em;--rc-font-size-md:.875em;--rc-font-size-lg:1.25em;--rc-font-size-base:14px;--rc-font-size-small:12px;--rc-line-height:1.5;--rc-line-height-tight:1.3;--rc-font-family:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm:3px;--rc-radius-md:6px;--rc-radius-lg:12px}.dark .gd62m00,[data-theme=dark] .gd62m00,.dark.gd62m00,[data-theme=dark].gd62m00,.dark .gd62m01,[data-theme=dark] .gd62m01,.dark.gd62m01,[data-theme=dark].gd62m01,.dark .gd62m02,[data-theme=dark] .gd62m02,.dark.gd62m02,[data-theme=dark].gd62m02{--rc-text:#fafafa;--rc-text-secondary:#a1a1aa;--rc-text-tertiary:#71717a;--rc-text-quaternary:#52525b;--rc-bg:#09090b;--rc-bg-secondary:#18181b;--rc-bg-tertiary:#27272a;--rc-fill:#2a2a2f;--rc-fill-secondary:#222226;--rc-fill-tertiary:#1b1b1f;--rc-fill-quaternary:#131316;--rc-border:#27272a;--rc-accent:#60a5fa;--rc-accent-light:#60a5fa20;--rc-link:#60a5fa;--rc-code-text:#e4e4e7;--rc-code-bg:#27272a;--rc-hr-border:#27272a;--rc-quote-border:#60a5fa;--rc-quote-bg:#1e3a5f;--rc-alert-info:#7db9e5;--rc-alert-warning:#da864a;--rc-alert-tip:#54da48;--rc-alert-caution:#e16973;--rc-alert-important:#9966e0;--rc-shadow-top-bar:0 8px 30px #00000073, 0 2px 8px #0000004d;--rc-shadow-modal:0 10px 15px -3px #0006, 0 4px 6px -4px #00000059;--rc-shadow-menu:0 1px 4px #00000040, 0 4px 16px #0006}.t6ga9o0{color:var(--rc-alert-caution)}.t6ga9o0[data-highlighted]{color:var(--rc-alert-caution);background-color:color-mix(in srgb, var(--rc-alert-caution) 8%, transparent)}.t6ga9o1{z-index:20;opacity:0;transition:opacity .15s,background-color .15s;position:fixed}.t6ga9o1:hover,.t6ga9o2{opacity:1}.t6ga9o3{z-index:30;opacity:0;pointer-events:none;align-items:center;gap:1px;transition:opacity .15s;display:flex;position:absolute}.t6ga9o4{opacity:1;pointer-events:auto}.t6ga9o5{width:16px;height:16px;color:color-mix(in srgb, var(--rc-text) 35%, transparent);cursor:pointer;background:0 0;border:none;border-radius:3px;justify-content:center;align-items:center;padding:0;transition:background-color .15s,color .15s;display:flex}.t6ga9o5:hover{background:color-mix(in srgb, var(--rc-text) 8%, transparent);color:color-mix(in srgb, var(--rc-text) 70%, transparent)}
|
|
2
|
-
/*$vite$:1*/
|
|
1
|
+
:root{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-fill: #e8e8ec;--rc-fill-secondary: #eeeeef;--rc-fill-tertiary: #f4f4f6;--rc-fill-quaternary: #f9f9fa;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}:root.dark{--rc-text: #fafafa;--rc-text-secondary: #a1a1aa;--rc-text-tertiary: #71717a;--rc-text-quaternary: #52525b;--rc-bg: #09090b;--rc-bg-secondary: #18181b;--rc-bg-tertiary: #27272a;--rc-fill: #2a2a2f;--rc-fill-secondary: #222226;--rc-fill-tertiary: #1b1b1f;--rc-fill-quaternary: #131316;--rc-border: #27272a;--rc-accent: #60a5fa;--rc-accent-light: #60a5fa20;--rc-link: #60a5fa;--rc-code-text: #e4e4e7;--rc-code-bg: #27272a;--rc-hr-border: #27272a;--rc-quote-border: #60a5fa;--rc-quote-bg: #1e3a5f;--rc-alert-info: #7db9e5;--rc-alert-warning: #da864a;--rc-alert-tip: #54da48;--rc-alert-caution: #e16973;--rc-alert-important: #9966e0;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -4px rgba(0,0,0,.35);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.25), 0 4px 16px rgba(0,0,0,.4);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}.gd62m00{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-fill: #e8e8ec;--rc-fill-secondary: #eeeeef;--rc-fill-tertiary: #f4f4f6;--rc-fill-quaternary: #f9f9fa;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}.gd62m01{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-fill: #e8e8ec;--rc-fill-secondary: #eeeeef;--rc-fill-tertiary: #f4f4f6;--rc-fill-quaternary: #f9f9fa;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.8;--rc-line-height-tight: 1.4;--rc-font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}.gd62m02{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-fill: #e8e8ec;--rc-fill-secondary: #eeeeef;--rc-fill-tertiary: #f4f4f6;--rc-fill-quaternary: #f9f9fa;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #a1a1aa;--rc-quote-bg: #fafafa;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: none;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 2px;--rc-space-sm: 4px;--rc-space-md: 10px;--rc-space-lg: 16px;--rc-space-xl: 20px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 14px;--rc-font-size-small: 12px;--rc-line-height: 1.5;--rc-line-height-tight: 1.3;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 3px;--rc-radius-md: 6px;--rc-radius-lg: 12px}.dark .gd62m00,[data-theme=dark] .gd62m00,.dark.gd62m00,[data-theme=dark].gd62m00,.dark .gd62m01,[data-theme=dark] .gd62m01,.dark.gd62m01,[data-theme=dark].gd62m01,.dark .gd62m02,[data-theme=dark] .gd62m02,.dark.gd62m02,[data-theme=dark].gd62m02{--rc-text: #fafafa;--rc-text-secondary: #a1a1aa;--rc-text-tertiary: #71717a;--rc-text-quaternary: #52525b;--rc-bg: #09090b;--rc-bg-secondary: #18181b;--rc-bg-tertiary: #27272a;--rc-fill: #2a2a2f;--rc-fill-secondary: #222226;--rc-fill-tertiary: #1b1b1f;--rc-fill-quaternary: #131316;--rc-border: #27272a;--rc-accent: #60a5fa;--rc-accent-light: #60a5fa20;--rc-link: #60a5fa;--rc-code-text: #e4e4e7;--rc-code-bg: #27272a;--rc-hr-border: #27272a;--rc-quote-border: #60a5fa;--rc-quote-bg: #1e3a5f;--rc-alert-info: #7db9e5;--rc-alert-warning: #da864a;--rc-alert-tip: #54da48;--rc-alert-caution: #e16973;--rc-alert-important: #9966e0;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -4px rgba(0,0,0,.35);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.25), 0 4px 16px rgba(0,0,0,.4)}.t6ga9o0{color:var(--rc-alert-caution)}.t6ga9o0[data-highlighted]{color:var(--rc-alert-caution);background-color:color-mix(in srgb,var(--rc-alert-caution) 8%,transparent)}.t6ga9o1{position:fixed;z-index:20;opacity:0;transition:opacity .15s,background-color .15s}.t6ga9o1:hover,.t6ga9o2{opacity:1}.t6ga9o3{display:flex;align-items:center;gap:1px;position:absolute;z-index:30;opacity:0;pointer-events:none;transition:opacity .15s}.t6ga9o4{opacity:1;pointer-events:auto}.t6ga9o5{display:flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:3px;border:none;background:transparent;color:color-mix(in srgb,var(--rc-text) 35%,transparent);cursor:pointer;padding:0;transition:background-color .15s,color .15s}.t6ga9o5:hover{background:color-mix(in srgb,var(--rc-text) 8%,transparent);color:color-mix(in srgb,var(--rc-text) 70%,transparent)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-plugin-table",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.83",
|
|
4
4
|
"description": "Table editing plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@haklex/rich-
|
|
25
|
-
"@haklex/rich-
|
|
24
|
+
"@haklex/rich-editor-ui": "0.0.83",
|
|
25
|
+
"@haklex/rich-style-token": "0.0.83"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@lexical/react": "^0.41.0",
|