@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/dist/index.js CHANGED
@@ -32134,6 +32134,7 @@ function useUEditorTableInteractions(editor) {
32134
32134
  const activeTableCellHighlightRef = useRef32(null);
32135
32135
  const hoveredTableCellRef = useRef32(null);
32136
32136
  const activeTableCellRef = useRef32(null);
32137
+ const suppressActiveCellHighlightRef = useRef32(false);
32137
32138
  const tableLayoutSyncFrameRef = useRef32(null);
32138
32139
  const setEditorResizeCursor = React75.useCallback((cursor) => {
32139
32140
  const proseMirror = editorContentRef.current?.querySelector(".ProseMirror");
@@ -32164,7 +32165,7 @@ function useUEditorTableInteractions(editor) {
32164
32165
  const surface = editorContentRef.current;
32165
32166
  const highlight = activeTableCellHighlightRef.current;
32166
32167
  if (!highlight) return;
32167
- if (!surface || !cell) {
32168
+ if (suppressActiveCellHighlightRef.current || !surface || !cell) {
32168
32169
  highlight.style.display = "none";
32169
32170
  return;
32170
32171
  }
@@ -32324,16 +32325,31 @@ function useUEditorTableInteractions(editor) {
32324
32325
  const row = cell.closest("tr");
32325
32326
  const table = cell.closest("table");
32326
32327
  if (!(row instanceof HTMLTableRowElement) || !(table instanceof HTMLTableElement)) return;
32327
- beginResize(event, table, row, cell);
32328
+ if (beginResize(event, table, row, cell)) {
32329
+ suppressActiveCellHighlightRef.current = true;
32330
+ updateActiveCellHighlight(null);
32331
+ }
32328
32332
  };
32329
32333
  const handlePointerMove = (event) => {
32330
32334
  handleRowResizePointerMove(event);
32331
32335
  };
32332
32336
  const handlePointerUp = (event) => {
32337
+ const wasRowResizing = isRowResizing();
32333
32338
  handleRowResizePointerUp(event);
32339
+ if (wasRowResizing) {
32340
+ suppressActiveCellHighlightRef.current = false;
32341
+ requestAnimationFrame(() => {
32342
+ updateActiveCellHighlight(activeTableCellRef.current);
32343
+ });
32344
+ }
32334
32345
  };
32335
32346
  const handleWindowBlur = () => {
32347
+ const wasRowResizing = isRowResizing();
32336
32348
  cancelResize();
32349
+ if (wasRowResizing) {
32350
+ suppressActiveCellHighlightRef.current = false;
32351
+ updateActiveCellHighlight(activeTableCellRef.current);
32352
+ }
32337
32353
  };
32338
32354
  proseMirror.addEventListener("mousemove", handleEditorMouseMove);
32339
32355
  proseMirror.addEventListener("mouseleave", handleEditorMouseLeave);
@@ -32377,6 +32393,7 @@ function useUEditorTableInteractions(editor) {
32377
32393
  tableLayoutSyncFrameRef.current = null;
32378
32394
  }
32379
32395
  cleanupRowResize();
32396
+ suppressActiveCellHighlightRef.current = false;
32380
32397
  document.body.style.cursor = "";
32381
32398
  clearActiveTableCell();
32382
32399
  clearHoveredTableCell();
@@ -32595,6 +32612,7 @@ var UEditor = React76.forwardRef(({
32595
32612
  {
32596
32613
  ref: activeTableCellHighlightRef,
32597
32614
  "aria-hidden": "true",
32615
+ "data-ueditor-active-cell-highlight": "",
32598
32616
  className: "pointer-events-none hidden absolute z-20 rounded-[2px] border-2 border-primary bg-primary/10 transition-[left,top,width,height] duration-100"
32599
32617
  }
32600
32618
  ),