@haklex/rich-plugin-table 0.0.80 → 0.0.81

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 CHANGED
@@ -1,542 +1,567 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
1
  import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
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";
2
+ import { $deleteTableColumn__EXPERIMENTAL, $deleteTableRow__EXPERIMENTAL, $getTableCellNodeFromLexicalNode, $getTableNodeFromLexicalNodeOrThrow, $insertTableRowAtSelection, $isTableCellNode } from "@lexical/table";
3
+ import { $createRangeSelection, $getNearestNodeFromDOMNode, $setSelection } from "lexical";
4
+ import { useCallback, useEffect, useRef, useState } from "react";
6
5
  import { createPortal } from "react-dom";
7
- import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator } from "@haklex/rich-editor-ui";
8
- import { Plus, GripVertical, ArrowUp, ArrowDown, Trash2, ArrowLeft, ArrowRight } from "lucide-react";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "@haklex/rich-editor-ui";
8
+ import { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, GripVertical, Plus, Trash2 } from "lucide-react";
9
+ //#region src/styles.css.ts
9
10
  var menuItemDestructive = "t6ga9o0";
10
- var resizeHandle = "t6ga9o1";
11
- var resizeHandleActive = "t6ga9o2";
12
11
  var rowColHandle = "t6ga9o3";
13
12
  var rowColHandleVisible = "t6ga9o4";
14
13
  var handleBtn = "t6ga9o5";
15
- const RESIZER_HANDLE_ATTR = "data-table-resizer-handle";
14
+ //#endregion
15
+ //#region src/TableCellResizerPlugin.tsx
16
+ var RESIZER_HANDLE_ATTR = "data-table-resizer-handle";
16
17
  function TableCellResizerInner({ editor }) {
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
- ] });
18
+ const [activeCell, setActiveCell] = useState(null);
19
+ const [resizing, setResizing] = useState(false);
20
+ const [direction, setDirection] = useState(null);
21
+ const [handlePos, setHandlePos] = useState({
22
+ right: null,
23
+ bottom: null
24
+ });
25
+ const startXRef = useRef(0);
26
+ const startYRef = useRef(0);
27
+ const startWidthRef = useRef(0);
28
+ const startHeightRef = useRef(0);
29
+ const cleanupRef = useRef(null);
30
+ const activeCellRef = useRef(null);
31
+ const updateHandlePos = useCallback((cell) => {
32
+ if (!cell) {
33
+ setHandlePos({
34
+ right: null,
35
+ bottom: null
36
+ });
37
+ return;
38
+ }
39
+ const rect = cell.getBoundingClientRect();
40
+ setHandlePos({
41
+ right: {
42
+ top: rect.top,
43
+ left: rect.right - 4,
44
+ height: rect.height
45
+ },
46
+ bottom: {
47
+ top: rect.bottom - 4,
48
+ left: rect.left,
49
+ width: rect.width
50
+ }
51
+ });
52
+ }, []);
53
+ useEffect(() => {
54
+ return () => {
55
+ cleanupRef.current?.();
56
+ };
57
+ }, []);
58
+ useEffect(() => {
59
+ const rootElement = editor.getRootElement();
60
+ if (!rootElement) return;
61
+ const handleMouseMove = (e) => {
62
+ if (resizing) return;
63
+ const cell = e.target.closest("td, th");
64
+ if (cell && rootElement.contains(cell)) {
65
+ activeCellRef.current = cell;
66
+ setActiveCell(cell);
67
+ updateHandlePos(cell);
68
+ } else {
69
+ activeCellRef.current = null;
70
+ setActiveCell(null);
71
+ updateHandlePos(null);
72
+ }
73
+ };
74
+ const handleMouseLeave = (e) => {
75
+ if (e.relatedTarget?.closest?.(`[${RESIZER_HANDLE_ATTR}="true"]`)) return;
76
+ if (!resizing) {
77
+ activeCellRef.current = null;
78
+ setActiveCell(null);
79
+ updateHandlePos(null);
80
+ }
81
+ };
82
+ rootElement.addEventListener("mousemove", handleMouseMove);
83
+ rootElement.addEventListener("mouseleave", handleMouseLeave);
84
+ return () => {
85
+ rootElement.removeEventListener("mousemove", handleMouseMove);
86
+ rootElement.removeEventListener("mouseleave", handleMouseLeave);
87
+ };
88
+ }, [
89
+ editor,
90
+ resizing,
91
+ updateHandlePos
92
+ ]);
93
+ useEffect(() => {
94
+ if (!activeCell || resizing) return;
95
+ const onViewportChange = () => {
96
+ updateHandlePos(activeCellRef.current);
97
+ };
98
+ window.addEventListener("scroll", onViewportChange, true);
99
+ window.addEventListener("resize", onViewportChange);
100
+ return () => {
101
+ window.removeEventListener("scroll", onViewportChange, true);
102
+ window.removeEventListener("resize", onViewportChange);
103
+ };
104
+ }, [
105
+ activeCell,
106
+ resizing,
107
+ updateHandlePos
108
+ ]);
109
+ const onPointerDown = useCallback((dir, e) => {
110
+ e.preventDefault();
111
+ e.stopPropagation();
112
+ if (!activeCell) return;
113
+ setResizing(true);
114
+ setDirection(dir);
115
+ startXRef.current = e.clientX;
116
+ startYRef.current = e.clientY;
117
+ startWidthRef.current = activeCell.offsetWidth;
118
+ startHeightRef.current = activeCell.offsetHeight;
119
+ const capturedCell = activeCell;
120
+ const onPointerMove = (ev) => {
121
+ if (dir === "right") {
122
+ const diff = ev.clientX - startXRef.current;
123
+ const newWidth = Math.max(50, startWidthRef.current + diff);
124
+ const colIndex = capturedCell.cellIndex;
125
+ const table = capturedCell.closest("table");
126
+ if (table) {
127
+ table.querySelectorAll("tr").forEach((row) => {
128
+ const cells = row.querySelectorAll("td, th");
129
+ if (cells[colIndex]) cells[colIndex].style.width = `${newWidth}px`;
130
+ });
131
+ updateHandlePos(capturedCell);
132
+ }
133
+ } else {
134
+ const diff = ev.clientY - startYRef.current;
135
+ const newHeight = Math.max(30, startHeightRef.current + diff);
136
+ const row = capturedCell.parentElement;
137
+ if (row) {
138
+ row.style.height = `${newHeight}px`;
139
+ updateHandlePos(capturedCell);
140
+ }
141
+ }
142
+ };
143
+ const cleanup = () => {
144
+ document.removeEventListener("pointermove", onPointerMove);
145
+ document.removeEventListener("pointerup", onPointerUp);
146
+ cleanupRef.current = null;
147
+ };
148
+ const onPointerUp = (ev) => {
149
+ cleanup();
150
+ setResizing(false);
151
+ setDirection(null);
152
+ if (dir === "right") {
153
+ const diff = ev.clientX - startXRef.current;
154
+ const newWidth = Math.max(50, startWidthRef.current + diff);
155
+ editor.update(() => {
156
+ const node = $getNearestNodeFromDOMNode(capturedCell);
157
+ if (node && $isTableCellNode(node)) node.setWidth(newWidth);
158
+ });
159
+ } else {
160
+ const diff = ev.clientY - startYRef.current;
161
+ const newHeight = Math.max(30, startHeightRef.current + diff);
162
+ editor.update(() => {
163
+ const node = $getNearestNodeFromDOMNode(capturedCell);
164
+ if (node && $isTableCellNode(node)) {
165
+ $getTableNodeFromLexicalNodeOrThrow(node);
166
+ const row = node.getParent();
167
+ if (row) {
168
+ const rowDOM = editor.getElementByKey(row.getKey());
169
+ if (rowDOM) rowDOM.style.height = `${newHeight}px`;
170
+ }
171
+ }
172
+ });
173
+ }
174
+ };
175
+ cleanupRef.current = cleanup;
176
+ document.addEventListener("pointermove", onPointerMove);
177
+ document.addEventListener("pointerup", onPointerUp);
178
+ }, [
179
+ activeCell,
180
+ editor,
181
+ updateHandlePos
182
+ ]);
183
+ if (!activeCell) return null;
184
+ return /* @__PURE__ */ jsxs(Fragment, { children: [handlePos.right && /* @__PURE__ */ jsx("div", {
185
+ className: `t6ga9o1 ${direction === "right" ? "t6ga9o2" : ""}`,
186
+ "data-table-resizer-handle": "true",
187
+ "data-testid": "table-cell-resizer-right",
188
+ style: {
189
+ top: handlePos.right.top,
190
+ left: handlePos.right.left,
191
+ height: handlePos.right.height,
192
+ width: 8,
193
+ cursor: "col-resize",
194
+ 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)"
195
+ },
196
+ onPointerDown: (e) => onPointerDown("right", e)
197
+ }), handlePos.bottom && /* @__PURE__ */ jsx("div", {
198
+ className: `t6ga9o1 ${direction === "bottom" ? "t6ga9o2" : ""}`,
199
+ "data-table-resizer-handle": "true",
200
+ "data-testid": "table-cell-resizer-bottom",
201
+ style: {
202
+ top: handlePos.bottom.top,
203
+ left: handlePos.bottom.left,
204
+ width: handlePos.bottom.width,
205
+ height: 8,
206
+ cursor: "row-resize",
207
+ 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)"
208
+ },
209
+ onPointerDown: (e) => onPointerDown("bottom", e)
210
+ })] });
215
211
  }
216
212
  function TableCellResizerPlugin() {
217
- const [editor] = useLexicalComposerContext();
218
- return createPortal(/* @__PURE__ */ jsx(TableCellResizerInner, { editor }), document.body);
213
+ const [editor] = useLexicalComposerContext();
214
+ return createPortal(/* @__PURE__ */ jsx(TableCellResizerInner, { editor }), document.body);
219
215
  }
220
- const HIDE_DELAY = 300;
221
- const ICON_SIZE = 12;
222
- const ROW_HANDLE_HEIGHT = 16;
223
- const COL_HANDLE_WIDTH = 34;
216
+ //#endregion
217
+ //#region src/TableRowColumnHandlesPlugin.tsx
218
+ var HIDE_DELAY = 300;
219
+ var ICON_SIZE = 12;
220
+ var ROW_HANDLE_HEIGHT = 16;
221
+ var COL_HANDLE_WIDTH = 34;
224
222
  function toPagePosition(rect) {
225
- return {
226
- top: rect.top + window.scrollY,
227
- left: rect.left + window.scrollX
228
- };
223
+ return {
224
+ top: rect.top + window.scrollY,
225
+ left: rect.left + window.scrollX
226
+ };
229
227
  }
230
228
  function selectCellAtIndex(table, rowIdx, colIdx, editor) {
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
- });
229
+ const targetRow = table.querySelectorAll("tr")[rowIdx];
230
+ if (!targetRow) return;
231
+ const cells = targetRow.querySelectorAll("td, th");
232
+ const targetCell = cells[colIdx] ?? cells[0];
233
+ if (!targetCell) return;
234
+ editor.update(() => {
235
+ const node = $getNearestNodeFromDOMNode(targetCell);
236
+ if (!node) return;
237
+ const cellNode = $getTableCellNodeFromLexicalNode(node);
238
+ if (!cellNode || !$isTableCellNode(cellNode)) return;
239
+ const firstChild = cellNode.getFirstChild();
240
+ if (firstChild) {
241
+ const sel = $createRangeSelection();
242
+ sel.anchor.set(firstChild.getKey(), 0, "element");
243
+ sel.focus.set(firstChild.getKey(), 0, "element");
244
+ $setSelection(sel);
245
+ }
246
+ });
250
247
  }
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
- ] });
248
+ function TableRowColumnHandlesInner({ editor }) {
249
+ const [rowHandle, setRowHandle] = useState({
250
+ visible: false,
251
+ top: 0,
252
+ left: 0,
253
+ rowIndex: 0,
254
+ colIndex: 0
255
+ });
256
+ const [colHandle, setColHandle] = useState({
257
+ visible: false,
258
+ top: 0,
259
+ left: 0,
260
+ rowIndex: 0,
261
+ colIndex: 0
262
+ });
263
+ const tableRef = useRef(null);
264
+ const hideTimerRef = useRef(null);
265
+ const hoveringHandleRef = useRef(false);
266
+ const activeAnchorRef = useRef(null);
267
+ const clearHideTimer = useCallback(() => {
268
+ if (hideTimerRef.current) {
269
+ clearTimeout(hideTimerRef.current);
270
+ hideTimerRef.current = null;
271
+ }
272
+ }, []);
273
+ const scheduleHide = useCallback(() => {
274
+ clearHideTimer();
275
+ hideTimerRef.current = setTimeout(() => {
276
+ if (!hoveringHandleRef.current) {
277
+ activeAnchorRef.current = null;
278
+ setRowHandle((s) => ({
279
+ ...s,
280
+ visible: false
281
+ }));
282
+ setColHandle((s) => ({
283
+ ...s,
284
+ visible: false
285
+ }));
286
+ }
287
+ }, HIDE_DELAY);
288
+ }, [clearHideTimer]);
289
+ const handleEnter = useCallback(() => {
290
+ hoveringHandleRef.current = true;
291
+ clearHideTimer();
292
+ }, [clearHideTimer]);
293
+ const handleLeave = useCallback(() => {
294
+ hoveringHandleRef.current = false;
295
+ scheduleHide();
296
+ }, [scheduleHide]);
297
+ const updateHandlesFromAnchor = useCallback((anchor) => {
298
+ if (anchor !== void 0) activeAnchorRef.current = anchor;
299
+ const activeAnchor = activeAnchorRef.current;
300
+ if (!activeAnchor) return;
301
+ const { table, rowIndex, colIndex } = activeAnchor;
302
+ if (!table.isConnected) {
303
+ activeAnchorRef.current = null;
304
+ setRowHandle((s) => ({
305
+ ...s,
306
+ visible: false
307
+ }));
308
+ setColHandle((s) => ({
309
+ ...s,
310
+ visible: false
311
+ }));
312
+ return;
313
+ }
314
+ const row = table.querySelectorAll("tr")[rowIndex];
315
+ if (!row) {
316
+ activeAnchorRef.current = null;
317
+ setRowHandle((s) => ({
318
+ ...s,
319
+ visible: false
320
+ }));
321
+ setColHandle((s) => ({
322
+ ...s,
323
+ visible: false
324
+ }));
325
+ return;
326
+ }
327
+ const cells = row.querySelectorAll("td, th");
328
+ const cell = cells[colIndex] ?? cells[0];
329
+ if (!cell) {
330
+ activeAnchorRef.current = null;
331
+ setRowHandle((s) => ({
332
+ ...s,
333
+ visible: false
334
+ }));
335
+ setColHandle((s) => ({
336
+ ...s,
337
+ visible: false
338
+ }));
339
+ return;
340
+ }
341
+ tableRef.current = table;
342
+ const resolvedColIndex = cell.cellIndex;
343
+ activeAnchorRef.current = {
344
+ table,
345
+ rowIndex,
346
+ colIndex: resolvedColIndex
347
+ };
348
+ const cellRect = cell.getBoundingClientRect();
349
+ const tableRect = table.getBoundingClientRect();
350
+ const cellPage = toPagePosition(cellRect);
351
+ const tablePage = toPagePosition(tableRect);
352
+ setRowHandle({
353
+ visible: true,
354
+ top: cellPage.top + cellRect.height / 2 - ROW_HANDLE_HEIGHT / 2,
355
+ left: tablePage.left - 38,
356
+ rowIndex,
357
+ colIndex: resolvedColIndex
358
+ });
359
+ setColHandle({
360
+ visible: true,
361
+ top: tablePage.top - 22,
362
+ left: cellPage.left + cellRect.width / 2 - COL_HANDLE_WIDTH / 2,
363
+ rowIndex,
364
+ colIndex: resolvedColIndex
365
+ });
366
+ }, []);
367
+ useEffect(() => {
368
+ const rootElement = editor.getRootElement();
369
+ if (!rootElement) return;
370
+ const onMouseMove = (e) => {
371
+ const target = e.target;
372
+ const cell = target.closest("td, th");
373
+ const table = target.closest("table");
374
+ if (!cell || !table || !rootElement.contains(table)) {
375
+ if (!hoveringHandleRef.current) scheduleHide();
376
+ return;
377
+ }
378
+ clearHideTimer();
379
+ const rowEl = cell.parentElement;
380
+ const rowIdx = rowEl ? rowEl.rowIndex : 0;
381
+ const colIdx = cell.cellIndex;
382
+ updateHandlesFromAnchor({
383
+ table,
384
+ rowIndex: rowIdx,
385
+ colIndex: colIdx
386
+ });
387
+ };
388
+ const onMouseLeave = () => {
389
+ if (!hoveringHandleRef.current) scheduleHide();
390
+ };
391
+ rootElement.addEventListener("mousemove", onMouseMove);
392
+ rootElement.addEventListener("mouseleave", onMouseLeave);
393
+ return () => {
394
+ rootElement.removeEventListener("mousemove", onMouseMove);
395
+ rootElement.removeEventListener("mouseleave", onMouseLeave);
396
+ clearHideTimer();
397
+ };
398
+ }, [
399
+ editor,
400
+ scheduleHide,
401
+ clearHideTimer,
402
+ updateHandlesFromAnchor
403
+ ]);
404
+ useEffect(() => {
405
+ const onViewportChange = () => {
406
+ updateHandlesFromAnchor();
407
+ };
408
+ window.addEventListener("scroll", onViewportChange, true);
409
+ window.addEventListener("resize", onViewportChange);
410
+ return () => {
411
+ window.removeEventListener("scroll", onViewportChange, true);
412
+ window.removeEventListener("resize", onViewportChange);
413
+ };
414
+ }, [updateHandlesFromAnchor]);
415
+ useEffect(() => {
416
+ return editor.registerUpdateListener(() => {
417
+ updateHandlesFromAnchor();
418
+ });
419
+ }, [editor, updateHandlesFromAnchor]);
420
+ const insertRowAbove = useCallback(() => {
421
+ const table = tableRef.current;
422
+ if (!table) return;
423
+ selectCellAtIndex(table, rowHandle.rowIndex, 0, editor);
424
+ editor.update(() => {
425
+ $insertTableRowAtSelection(false);
426
+ });
427
+ }, [editor, rowHandle.rowIndex]);
428
+ const insertRowBelow = useCallback(() => {
429
+ const table = tableRef.current;
430
+ if (!table) return;
431
+ selectCellAtIndex(table, rowHandle.rowIndex, 0, editor);
432
+ editor.update(() => {
433
+ $insertTableRowAtSelection(true);
434
+ });
435
+ }, [editor, rowHandle.rowIndex]);
436
+ const deleteRow = useCallback(() => {
437
+ const table = tableRef.current;
438
+ if (!table) return;
439
+ selectCellAtIndex(table, rowHandle.rowIndex, 0, editor);
440
+ editor.update(() => {
441
+ $deleteTableRow__EXPERIMENTAL();
442
+ });
443
+ }, [editor, rowHandle.rowIndex]);
444
+ const insertColumnLeft = useCallback(() => {
445
+ const table = tableRef.current;
446
+ if (!table) return;
447
+ selectCellAtIndex(table, 0, colHandle.colIndex, editor);
448
+ editor.update(() => {
449
+ $insertTableRowAtSelection(false);
450
+ });
451
+ }, [editor, colHandle.colIndex]);
452
+ const insertColumnRight = useCallback(() => {
453
+ const table = tableRef.current;
454
+ if (!table) return;
455
+ selectCellAtIndex(table, 0, colHandle.colIndex, editor);
456
+ editor.update(() => {
457
+ $insertTableRowAtSelection(true);
458
+ });
459
+ }, [editor, colHandle.colIndex]);
460
+ const deleteColumn = useCallback(() => {
461
+ const table = tableRef.current;
462
+ if (!table) return;
463
+ selectCellAtIndex(table, 0, colHandle.colIndex, editor);
464
+ editor.update(() => {
465
+ $deleteTableColumn__EXPERIMENTAL();
466
+ });
467
+ }, [editor, colHandle.colIndex]);
468
+ const addRowBelow = useCallback(() => {
469
+ const table = tableRef.current;
470
+ if (!table) return;
471
+ selectCellAtIndex(table, rowHandle.rowIndex, 0, editor);
472
+ editor.update(() => {
473
+ $insertTableRowAtSelection(true);
474
+ });
475
+ }, [editor, rowHandle.rowIndex]);
476
+ const addColumnLeft = useCallback(() => {
477
+ const table = tableRef.current;
478
+ if (!table) return;
479
+ selectCellAtIndex(table, 0, colHandle.colIndex, editor);
480
+ editor.update(() => {
481
+ $insertTableRowAtSelection(false);
482
+ });
483
+ }, [editor, colHandle.colIndex]);
484
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
485
+ className: `${rowColHandle} ${rowHandle.visible ? rowColHandleVisible : ""}`,
486
+ style: {
487
+ top: rowHandle.top,
488
+ left: rowHandle.left
489
+ },
490
+ onMouseEnter: handleEnter,
491
+ onMouseLeave: handleLeave,
492
+ children: [/* @__PURE__ */ jsx("button", {
493
+ "aria-label": "Add row",
494
+ className: handleBtn,
495
+ type: "button",
496
+ onClick: addRowBelow,
497
+ children: /* @__PURE__ */ jsx(Plus, { size: ICON_SIZE })
498
+ }), /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
499
+ className: handleBtn,
500
+ children: /* @__PURE__ */ jsx(GripVertical, { size: ICON_SIZE })
501
+ }), /* @__PURE__ */ jsxs(DropdownMenuContent, {
502
+ align: "start",
503
+ side: "right",
504
+ sideOffset: 4,
505
+ children: [
506
+ /* @__PURE__ */ jsxs(DropdownMenuItem, {
507
+ onClick: insertRowAbove,
508
+ children: [/* @__PURE__ */ jsx(ArrowUp, { size: 14 }), "Insert row above"]
509
+ }),
510
+ /* @__PURE__ */ jsxs(DropdownMenuItem, {
511
+ onClick: insertRowBelow,
512
+ children: [/* @__PURE__ */ jsx(ArrowDown, { size: 14 }), "Insert row below"]
513
+ }),
514
+ /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
515
+ /* @__PURE__ */ jsxs(DropdownMenuItem, {
516
+ className: menuItemDestructive,
517
+ onClick: deleteRow,
518
+ children: [/* @__PURE__ */ jsx(Trash2, { size: 14 }), "Delete row"]
519
+ })
520
+ ]
521
+ })] })]
522
+ }), /* @__PURE__ */ jsxs("div", {
523
+ className: `${rowColHandle} ${colHandle.visible ? rowColHandleVisible : ""}`,
524
+ style: {
525
+ top: colHandle.top,
526
+ left: colHandle.left
527
+ },
528
+ onMouseEnter: handleEnter,
529
+ onMouseLeave: handleLeave,
530
+ children: [/* @__PURE__ */ jsx("button", {
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
+ })] });
534
561
  }
535
562
  function TableRowColumnHandlesPlugin() {
536
- const [editor] = useLexicalComposerContext();
537
- return createPortal(/* @__PURE__ */ jsx(TableRowColumnHandlesInner, { editor }), document.body);
563
+ const [editor] = useLexicalComposerContext();
564
+ return createPortal(/* @__PURE__ */ jsx(TableRowColumnHandlesInner, { editor }), document.body);
538
565
  }
539
- export {
540
- TableCellResizerPlugin,
541
- TableRowColumnHandlesPlugin
542
- };
566
+ //#endregion
567
+ export { TableCellResizerPlugin, TableRowColumnHandlesPlugin };
@@ -1 +1,2 @@
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)}
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*/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haklex/rich-plugin-table",
3
- "version": "0.0.80",
3
+ "version": "0.0.81",
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-editor-ui": "0.0.80",
25
- "@haklex/rich-style-token": "0.0.80"
24
+ "@haklex/rich-editor-ui": "0.0.81",
25
+ "@haklex/rich-style-token": "0.0.81"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@lexical/react": "^0.41.0",