@underverse-ui/underverse 1.0.103 → 1.0.104
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/api-reference.json +1 -1
- package/dist/index.cjs +20 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/api-reference.json
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -32224,6 +32224,7 @@ function useUEditorTableInteractions(editor) {
|
|
|
32224
32224
|
const activeTableCellHighlightRef = (0, import_react53.useRef)(null);
|
|
32225
32225
|
const hoveredTableCellRef = (0, import_react53.useRef)(null);
|
|
32226
32226
|
const activeTableCellRef = (0, import_react53.useRef)(null);
|
|
32227
|
+
const suppressActiveCellHighlightRef = (0, import_react53.useRef)(false);
|
|
32227
32228
|
const tableLayoutSyncFrameRef = (0, import_react53.useRef)(null);
|
|
32228
32229
|
const setEditorResizeCursor = import_react53.default.useCallback((cursor) => {
|
|
32229
32230
|
const proseMirror = editorContentRef.current?.querySelector(".ProseMirror");
|
|
@@ -32254,7 +32255,7 @@ function useUEditorTableInteractions(editor) {
|
|
|
32254
32255
|
const surface = editorContentRef.current;
|
|
32255
32256
|
const highlight = activeTableCellHighlightRef.current;
|
|
32256
32257
|
if (!highlight) return;
|
|
32257
|
-
if (!surface || !cell) {
|
|
32258
|
+
if (suppressActiveCellHighlightRef.current || !surface || !cell) {
|
|
32258
32259
|
highlight.style.display = "none";
|
|
32259
32260
|
return;
|
|
32260
32261
|
}
|
|
@@ -32414,16 +32415,31 @@ function useUEditorTableInteractions(editor) {
|
|
|
32414
32415
|
const row = cell.closest("tr");
|
|
32415
32416
|
const table = cell.closest("table");
|
|
32416
32417
|
if (!(row instanceof HTMLTableRowElement) || !(table instanceof HTMLTableElement)) return;
|
|
32417
|
-
beginResize(event, table, row, cell)
|
|
32418
|
+
if (beginResize(event, table, row, cell)) {
|
|
32419
|
+
suppressActiveCellHighlightRef.current = true;
|
|
32420
|
+
updateActiveCellHighlight(null);
|
|
32421
|
+
}
|
|
32418
32422
|
};
|
|
32419
32423
|
const handlePointerMove = (event) => {
|
|
32420
32424
|
handleRowResizePointerMove(event);
|
|
32421
32425
|
};
|
|
32422
32426
|
const handlePointerUp = (event) => {
|
|
32427
|
+
const wasRowResizing = isRowResizing();
|
|
32423
32428
|
handleRowResizePointerUp(event);
|
|
32429
|
+
if (wasRowResizing) {
|
|
32430
|
+
suppressActiveCellHighlightRef.current = false;
|
|
32431
|
+
requestAnimationFrame(() => {
|
|
32432
|
+
updateActiveCellHighlight(activeTableCellRef.current);
|
|
32433
|
+
});
|
|
32434
|
+
}
|
|
32424
32435
|
};
|
|
32425
32436
|
const handleWindowBlur = () => {
|
|
32437
|
+
const wasRowResizing = isRowResizing();
|
|
32426
32438
|
cancelResize();
|
|
32439
|
+
if (wasRowResizing) {
|
|
32440
|
+
suppressActiveCellHighlightRef.current = false;
|
|
32441
|
+
updateActiveCellHighlight(activeTableCellRef.current);
|
|
32442
|
+
}
|
|
32427
32443
|
};
|
|
32428
32444
|
proseMirror.addEventListener("mousemove", handleEditorMouseMove);
|
|
32429
32445
|
proseMirror.addEventListener("mouseleave", handleEditorMouseLeave);
|
|
@@ -32467,6 +32483,7 @@ function useUEditorTableInteractions(editor) {
|
|
|
32467
32483
|
tableLayoutSyncFrameRef.current = null;
|
|
32468
32484
|
}
|
|
32469
32485
|
cleanupRowResize();
|
|
32486
|
+
suppressActiveCellHighlightRef.current = false;
|
|
32470
32487
|
document.body.style.cursor = "";
|
|
32471
32488
|
clearActiveTableCell();
|
|
32472
32489
|
clearHoveredTableCell();
|
|
@@ -32685,6 +32702,7 @@ var UEditor = import_react54.default.forwardRef(({
|
|
|
32685
32702
|
{
|
|
32686
32703
|
ref: activeTableCellHighlightRef,
|
|
32687
32704
|
"aria-hidden": "true",
|
|
32705
|
+
"data-ueditor-active-cell-highlight": "",
|
|
32688
32706
|
className: "pointer-events-none hidden absolute z-20 rounded-[2px] border-2 border-primary bg-primary/10 transition-[left,top,width,height] duration-100"
|
|
32689
32707
|
}
|
|
32690
32708
|
),
|