@underverse-ui/underverse 1.0.127 → 1.0.128

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@underverse-ui/underverse",
3
- "version": "1.0.127",
3
+ "version": "1.0.128",
4
4
  "sourceEntry": "src/index.ts",
5
5
  "totalExports": 232,
6
6
  "exports": [
package/dist/index.cjs CHANGED
@@ -7404,7 +7404,7 @@ var DropdownMenuItem = ({
7404
7404
  disabled,
7405
7405
  onMouseDown: (e) => e.preventDefault(),
7406
7406
  className: cn(
7407
- "flex w-full items-center gap-2 px-3 py-2 text-sm rounded-lg transition-colors group",
7407
+ "flex w-full items-center gap-2 px-3 py-2 text-sm rounded-lg transition-colors group cursor-pointer",
7408
7408
  "hover:bg-accent hover:text-accent-foreground",
7409
7409
  "focus:bg-accent focus:text-accent-foreground focus:outline-none",
7410
7410
  "disabled:opacity-50 disabled:cursor-not-allowed",
@@ -25456,7 +25456,6 @@ function buildUEditorExtensions({
25456
25456
 
25457
25457
  // src/components/UEditor/toolbar.tsx
25458
25458
  var import_react49 = __toESM(require("react"), 1);
25459
- var import_react_dom8 = require("react-dom");
25460
25459
  var import_react50 = require("@tiptap/react");
25461
25460
  var import_lucide_react44 = require("lucide-react");
25462
25461
 
@@ -25951,7 +25950,7 @@ var ToolbarButton = import_react49.default.forwardRef(({ onClick, onMouseDown, a
25951
25950
  onClick,
25952
25951
  disabled,
25953
25952
  className: cn(
25954
- "flex items-center justify-center w-8 h-8 rounded-md transition-colors duration-150",
25953
+ "flex items-center justify-center w-7 h-7 rounded-md transition-colors duration-150 cursor-pointer",
25955
25954
  "gap-0.5 [&_svg+svg]:-ml-1",
25956
25955
  "hover:bg-accent",
25957
25956
  "focus:outline-none focus:ring-2 focus:ring-primary/20",
@@ -26030,11 +26029,6 @@ var EditorToolbar = ({
26030
26029
  const fileInputRef = (0, import_react49.useRef)(null);
26031
26030
  const [isUploadingImage, setIsUploadingImage] = (0, import_react49.useState)(false);
26032
26031
  const [imageUploadError, setImageUploadError] = (0, import_react49.useState)(null);
26033
- const [fontSizeDraft, setFontSizeDraft] = (0, import_react49.useState)("");
26034
- const [isFontSizeMenuOpen, setIsFontSizeMenuOpen] = (0, import_react49.useState)(false);
26035
- const [fontSizeMenuPosition, setFontSizeMenuPosition] = (0, import_react49.useState)({ top: 0, left: 0 });
26036
- const fontSizeControlRef = (0, import_react49.useRef)(null);
26037
- const fontSizeMenuRef = (0, import_react49.useRef)(null);
26038
26032
  const isImageSelected = editor.isActive("image");
26039
26033
  const imageAttrs = editor.getAttributes("image");
26040
26034
  const tableAttrs = editor.getAttributes("table");
@@ -26060,53 +26054,6 @@ var EditorToolbar = ({
26060
26054
  const currentLineHeightLabel = availableLineHeights.find((option) => normalizeStyleValue(option.value) === currentLineHeight)?.label ?? t("toolbar.lineHeightDefault");
26061
26055
  const currentLetterSpacingLabel = availableLetterSpacings.find((option) => normalizeStyleValue(option.value) === currentLetterSpacing)?.label ?? t("toolbar.letterSpacingDefault");
26062
26056
  const displayedFontFamilyLabel = currentFontFamily ? currentFontFamilyLabel : availableFontFamilies[0]?.label ?? t("toolbar.fontDefault");
26063
- import_react49.default.useEffect(() => {
26064
- if (document.activeElement === fontSizeControlRef.current?.querySelector("input")) return;
26065
- setFontSizeDraft(currentFontSize.replace(/px$/i, "") || "16");
26066
- }, [currentFontSize]);
26067
- const applyFontSizeDraft = () => {
26068
- const normalized = fontSizeDraft.trim();
26069
- if (!normalized) {
26070
- editor.chain().focus().unsetFontSize().run();
26071
- return;
26072
- }
26073
- const parsed = Number.parseFloat(normalized);
26074
- if (!Number.isFinite(parsed) || parsed <= 0) return;
26075
- const clamped = Math.min(96, Math.max(8, parsed));
26076
- editor.chain().focus().setFontSize(`${clamped}px`).run();
26077
- setFontSizeDraft(String(clamped));
26078
- };
26079
- const updateFontSizeMenuPosition = import_react49.default.useCallback(() => {
26080
- const rect = fontSizeControlRef.current?.getBoundingClientRect();
26081
- if (!rect) return;
26082
- setFontSizeMenuPosition({
26083
- top: Math.round(rect.bottom + 4),
26084
- left: Math.round(rect.left)
26085
- });
26086
- }, []);
26087
- const toggleFontSizeMenu = () => {
26088
- updateFontSizeMenuPosition();
26089
- setIsFontSizeMenuOpen((open) => !open);
26090
- };
26091
- import_react49.default.useEffect(() => {
26092
- if (!isFontSizeMenuOpen) return;
26093
- updateFontSizeMenuPosition();
26094
- const handlePointerDown = (event) => {
26095
- const target = event.target;
26096
- if (fontSizeControlRef.current?.contains(target)) return;
26097
- if (fontSizeMenuRef.current?.contains(target)) return;
26098
- setIsFontSizeMenuOpen(false);
26099
- };
26100
- const handleLayoutChange = () => updateFontSizeMenuPosition();
26101
- document.addEventListener("mousedown", handlePointerDown);
26102
- window.addEventListener("resize", handleLayoutChange);
26103
- window.addEventListener("scroll", handleLayoutChange, true);
26104
- return () => {
26105
- document.removeEventListener("mousedown", handlePointerDown);
26106
- window.removeEventListener("resize", handleLayoutChange);
26107
- window.removeEventListener("scroll", handleLayoutChange, true);
26108
- };
26109
- }, [isFontSizeMenuOpen, updateFontSizeMenuPosition]);
26110
26057
  const insertImageFiles = async (files) => {
26111
26058
  if (files.length === 0) return;
26112
26059
  setIsUploadingImage(true);
@@ -26146,21 +26093,11 @@ var EditorToolbar = ({
26146
26093
  /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
26147
26094
  DropdownMenu,
26148
26095
  {
26149
- trigger: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
26150
- "button",
26151
- {
26152
- type: "button",
26153
- "aria-label": t("toolbar.fontFamily"),
26154
- className: cn(
26155
- "flex h-8 min-w-34 max-w-42 items-center justify-between gap-2 rounded-full border border-border/60 bg-muted/30 px-2.5 text-xs text-foreground",
26156
- "transition-colors hover:bg-accent focus:outline-none focus:ring-2 focus:ring-primary/20"
26157
- ),
26158
- children: [
26159
- /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "truncate", children: displayedFontFamilyLabel }),
26160
- /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_lucide_react44.ChevronDown, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" })
26161
- ]
26162
- }
26163
- ),
26096
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(ToolbarButton, { onClick: () => {
26097
+ }, title: t("toolbar.fontFamily"), className: "px-1.5 w-auto gap-0.5", children: [
26098
+ /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_lucide_react44.Baseline, { className: "w-4 h-4" }),
26099
+ /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_lucide_react44.ChevronDown, { className: "h-3 w-3 text-muted-foreground" })
26100
+ ] }),
26164
26101
  contentClassName: "max-h-80 overflow-y-auto min-w-56 p-2",
26165
26102
  children: [
26166
26103
  /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
@@ -26178,102 +26115,55 @@ var EditorToolbar = ({
26178
26115
  label: option.label,
26179
26116
  onClick: () => editor.chain().focus().setFontFamily(option.value).run(),
26180
26117
  active: normalizeStyleValue(option.value) === currentFontFamily,
26181
- className: "font-medium "
26118
+ className: "font-medium"
26182
26119
  },
26183
26120
  option.value
26184
26121
  ))
26185
26122
  ]
26186
26123
  }
26187
26124
  ),
26188
- /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(import_jsx_runtime81.Fragment, { children: [
26189
- /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
26190
- "div",
26191
- {
26192
- ref: fontSizeControlRef,
26193
- "aria-label": t("toolbar.fontSize"),
26194
- className: cn(
26195
- "flex h-8 min-w-14 items-center overflow-hidden rounded-full border border-border/60 bg-muted/30 text-xs font-semibold text-foreground",
26196
- "transition-colors focus-within:ring-2 focus-within:ring-primary/20"
26125
+ /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
26126
+ DropdownMenu,
26127
+ {
26128
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(ToolbarButton, { onClick: () => {
26129
+ }, title: t("toolbar.fontSize"), className: "px-1.5 w-auto gap-0.5", children: [
26130
+ /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "flex items-center gap-0.5", children: [
26131
+ /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_lucide_react44.ChevronsUpDown, { className: "h-3 w-3 text-muted-foreground", strokeWidth: 2.5 }),
26132
+ /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "text-xs font-bold leading-none", children: "A" })
26133
+ ] }),
26134
+ /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_lucide_react44.ChevronDown, { className: "h-3 w-3 text-muted-foreground" })
26135
+ ] }),
26136
+ contentClassName: "max-h-80 overflow-y-auto min-w-32 p-2",
26137
+ children: [
26138
+ /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
26139
+ DropdownMenuItem,
26140
+ {
26141
+ icon: import_lucide_react44.Type,
26142
+ label: t("toolbar.sizeDefault"),
26143
+ onClick: () => editor.chain().focus().unsetFontSize().run(),
26144
+ active: !currentFontSize
26145
+ }
26197
26146
  ),
26198
- children: [
26199
- /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
26200
- "input",
26201
- {
26202
- type: "number",
26203
- min: 8,
26204
- max: 96,
26205
- step: 1,
26206
- value: fontSizeDraft,
26207
- onChange: (e) => setFontSizeDraft(e.target.value),
26208
- onBlur: applyFontSizeDraft,
26209
- onMouseDown: (e) => e.stopPropagation(),
26210
- onClick: (e) => e.stopPropagation(),
26211
- onKeyDown: (e) => {
26212
- e.stopPropagation();
26213
- if (e.key === "Enter") {
26214
- e.preventDefault();
26215
- applyFontSizeDraft();
26216
- }
26217
- },
26218
- "aria-label": t("toolbar.fontSize"),
26219
- className: "h-full w-8 bg-transparent px-0.5 text-center text-xs font-semibold outline-none [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"
26220
- }
26221
- ),
26222
- /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
26223
- "button",
26224
- {
26225
- type: "button",
26226
- "aria-label": t("toolbar.fontSize"),
26227
- "aria-expanded": isFontSizeMenuOpen,
26228
- onClick: toggleFontSizeMenu,
26229
- className: "flex h-full w-5 items-center justify-center text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
26230
- children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_lucide_react44.ChevronDown, { className: "h-3.5 w-3.5" })
26231
- }
26232
- )
26233
- ]
26234
- }
26235
- ),
26236
- isFontSizeMenuOpen && typeof document !== "undefined" && (0, import_react_dom8.createPortal)(
26237
- /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
26238
- "div",
26239
- {
26240
- ref: fontSizeMenuRef,
26241
- className: "fixed z-[10000] max-h-64 w-12 overflow-y-auto rounded-md border border-border/70 bg-popover p-0.5 text-popover-foreground shadow-md",
26242
- style: { top: fontSizeMenuPosition.top, left: fontSizeMenuPosition.left },
26243
- children: availableFontSizes.map((option) => {
26244
- const active = normalizeStyleValue(option.value) === currentFontSize;
26245
- return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
26246
- "button",
26247
- {
26248
- type: "button",
26249
- onMouseDown: (e) => e.preventDefault(),
26250
- onClick: () => {
26251
- editor.chain().focus().setFontSize(option.value).run();
26252
- setFontSizeDraft(option.label);
26253
- setIsFontSizeMenuOpen(false);
26254
- },
26255
- className: cn(
26256
- "flex h-6 w-full items-center justify-center rounded text-xs leading-none transition-colors",
26257
- active ? "bg-primary/15 text-primary" : "text-foreground hover:bg-accent hover:text-accent-foreground"
26258
- ),
26259
- children: option.label
26260
- },
26261
- option.value
26262
- );
26263
- })
26264
- }
26265
- ),
26266
- document.body
26267
- )
26268
- ] }),
26147
+ availableFontSizes.map((option) => /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
26148
+ DropdownMenuItem,
26149
+ {
26150
+ label: option.label,
26151
+ onClick: () => editor.chain().focus().setFontSize(option.value).run(),
26152
+ active: normalizeStyleValue(option.value) === currentFontSize
26153
+ },
26154
+ option.value
26155
+ ))
26156
+ ]
26157
+ }
26158
+ ),
26269
26159
  /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
26270
26160
  DropdownMenu,
26271
26161
  {
26272
- contentClassName: "p-2",
26162
+ contentClassName: "p-1",
26273
26163
  trigger: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(ToolbarButton, { onClick: () => {
26274
- }, title: t("toolbar.textStyle"), className: "px-2 w-auto gap-1", children: [
26164
+ }, title: t("toolbar.textStyle"), className: "px-1.5 w-auto gap-0.5", children: [
26275
26165
  /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_lucide_react44.Type, { className: "w-4 h-4" }),
26276
- /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_lucide_react44.ChevronDown, { className: "w-3 h-3" })
26166
+ /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_lucide_react44.ChevronDown, { className: "h-3 w-3 text-muted-foreground" })
26277
26167
  ] }),
26278
26168
  children: [
26279
26169
  /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
@@ -26326,7 +26216,7 @@ var EditorToolbar = ({
26326
26216
  /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_lucide_react44.ArrowUp, { className: "w-3 h-3" }),
26327
26217
  /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_lucide_react44.ArrowDown, { className: "w-3 h-3" })
26328
26218
  ] }),
26329
- contentClassName: "max-h-72 overflow-y-auto p-2",
26219
+ contentClassName: "max-h-72 overflow-y-auto p-1",
26330
26220
  children: [
26331
26221
  /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
26332
26222
  DropdownMenuItem,
@@ -26357,7 +26247,7 @@ var EditorToolbar = ({
26357
26247
  /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_lucide_react44.ArrowLeft, { className: "w-3 h-3" }),
26358
26248
  /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_lucide_react44.ArrowRight, { className: "w-3 h-3" })
26359
26249
  ] }),
26360
- contentClassName: "max-h-72 overflow-y-auto p-2",
26250
+ contentClassName: "max-h-72 overflow-y-auto p-1",
26361
26251
  children: [
26362
26252
  /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
26363
26253
  DropdownMenuItem,
@@ -26913,7 +26803,7 @@ var EditorToolbar = ({
26913
26803
  // src/components/UEditor/menus.tsx
26914
26804
  var import_react51 = require("react");
26915
26805
  var import_react52 = require("@tiptap/react");
26916
- var import_react_dom9 = require("react-dom");
26806
+ var import_react_dom8 = require("react-dom");
26917
26807
  var import_lucide_react45 = require("lucide-react");
26918
26808
  var import_jsx_runtime82 = require("react/jsx-runtime");
26919
26809
  var FloatingSlashCommandMenu = ({ editor, onClose }) => {
@@ -27361,7 +27251,7 @@ var CustomBubbleMenu = ({
27361
27251
  };
27362
27252
  }, [editor]);
27363
27253
  if (!isVisible) return null;
27364
- return (0, import_react_dom9.createPortal)(
27254
+ return (0, import_react_dom8.createPortal)(
27365
27255
  /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
27366
27256
  "div",
27367
27257
  {
@@ -27417,7 +27307,7 @@ var CustomFloatingMenu = ({ editor }) => {
27417
27307
  };
27418
27308
  }, [editor]);
27419
27309
  if (!isVisible) return null;
27420
- return (0, import_react_dom9.createPortal)(
27310
+ return (0, import_react_dom8.createPortal)(
27421
27311
  /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
27422
27312
  "div",
27423
27313
  {
@@ -31999,15 +31889,12 @@ var FALLBACK_TABLE_COLUMN_WIDTH = 160;
31999
31889
  var MENU_HOVER_PADDING = 18;
32000
31890
  var ROW_HANDLE_HOVER_WIDTH = 28;
32001
31891
  var COLUMN_HANDLE_HOVER_HEIGHT = 28;
32002
- var ROW_HANDLE_GUTTER = 20;
32003
31892
  var TABLE_MENU_TOP_OFFSET = 10;
32004
- var COLUMN_HANDLE_TOP_OFFSET = 8;
32005
31893
  var ADD_COLUMN_RAIL_GAP = 4;
32006
31894
  var ADD_ROW_RAIL_GAP = 4;
32007
31895
  var ADD_COLUMN_HOVER_WIDTH = 24;
32008
31896
  var ADD_ROW_HOVER_HEIGHT = 24;
32009
31897
  var HANDLE_HOVER_RADIUS = 14;
32010
- var IDLE_HANDLE_OPACITY = "0.4";
32011
31898
  var IDLE_HANDLE_SCALE = "0.78";
32012
31899
  var DEFAULT_HOVER_STATE = {
32013
31900
  menuVisible: false,
@@ -32619,8 +32506,8 @@ function TableControls({ editor, containerRef }) {
32619
32506
  }
32620
32507
  const menuTop = Math.max(8, layout.tableTop - TABLE_MENU_TOP_OFFSET);
32621
32508
  const menuLeft = Math.max(8, layout.tableLeft);
32622
- const rowHandleLeft = Math.max(8, layout.tableLeft - ROW_HANDLE_GUTTER);
32623
- const columnHandleTop = Math.max(8, layout.tableTop - COLUMN_HANDLE_TOP_OFFSET);
32509
+ const rowHandleLeft = layout.tableLeft - 12;
32510
+ const columnHandleTop = layout.tableTop - 12;
32624
32511
  const visibleTableWidth = Math.min(layout.tableWidth, layout.viewportWidth);
32625
32512
  const visibleTableHeight = Math.min(layout.tableHeight, layout.viewportHeight);
32626
32513
  const columnRailTop = layout.tableTop;
@@ -32633,7 +32520,9 @@ function TableControls({ editor, containerRef }) {
32633
32520
  return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_jsx_runtime84.Fragment, { children: [
32634
32521
  layout.rowHandles.map((rowHandle) => {
32635
32522
  const menuKey = getRowMenuKey(rowHandle.index);
32523
+ const isActive = rowHandle.index === layout.activeRowIndex;
32636
32524
  const visible = controlsVisible || hoverState.rowHandleIndex === rowHandle.index || openMenuKey === menuKey;
32525
+ const isShown = visible || isActive;
32637
32526
  return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
32638
32527
  "div",
32639
32528
  {
@@ -32647,7 +32536,7 @@ function TableControls({ editor, containerRef }) {
32647
32536
  Tooltip,
32648
32537
  {
32649
32538
  placement: "right",
32650
- disabled: openMenuKey === menuKey,
32539
+ disabled: openMenuKey === menuKey || !visible && isActive,
32651
32540
  content: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "text-xs font-medium", children: `${t("tableMenu.dragRow")} ${rowHandle.index + 1}` }),
32652
32541
  children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
32653
32542
  DropdownMenu,
@@ -32684,16 +32573,15 @@ function TableControls({ editor, containerRef }) {
32684
32573
  document.body.style.cursor = "grabbing";
32685
32574
  },
32686
32575
  className: cn(
32687
- "inline-flex h-6 w-6 items-center justify-center rounded-full",
32688
- "border border-border/70 bg-background/95 text-muted-foreground shadow-sm backdrop-blur",
32689
- "cursor-grab active:cursor-grabbing",
32690
- "transition-[opacity,transform,colors] duration-150 hover:bg-accent hover:text-foreground"
32576
+ "inline-flex h-6 w-6 items-center justify-center rounded-full transition-[opacity,transform,colors,border,background-color] duration-150",
32577
+ visible ? "border border-border/70 bg-background/95 text-muted-foreground shadow-sm backdrop-blur hover:bg-accent hover:text-foreground cursor-grab active:cursor-grabbing" : "border-transparent bg-transparent cursor-pointer"
32691
32578
  ),
32692
32579
  style: {
32693
- opacity: visible ? 1 : Number(IDLE_HANDLE_OPACITY),
32694
- transform: visible ? "scale(1)" : `scale(${IDLE_HANDLE_SCALE})`
32580
+ opacity: isShown ? 1 : 0,
32581
+ transform: isShown ? "scale(1)" : `scale(${IDLE_HANDLE_SCALE})`,
32582
+ pointerEvents: isShown ? "auto" : "none"
32695
32583
  },
32696
- children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react46.GripVertical, { className: "h-3.5 w-3.5" })
32584
+ children: visible ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react46.GripVertical, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "h-3 w-1 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
32697
32585
  }
32698
32586
  )
32699
32587
  }
@@ -32706,7 +32594,9 @@ function TableControls({ editor, containerRef }) {
32706
32594
  }),
32707
32595
  layout.columnHandles.map((columnHandle) => {
32708
32596
  const menuKey = getColumnMenuKey(columnHandle.index);
32597
+ const isActive = columnHandle.index === layout.activeColumnIndex;
32709
32598
  const visible = controlsVisible || hoverState.columnHandleIndex === columnHandle.index || openMenuKey === menuKey;
32599
+ const isShown = visible || isActive;
32710
32600
  return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
32711
32601
  "div",
32712
32602
  {
@@ -32720,7 +32610,7 @@ function TableControls({ editor, containerRef }) {
32720
32610
  Tooltip,
32721
32611
  {
32722
32612
  placement: "top",
32723
- disabled: openMenuKey === menuKey,
32613
+ disabled: openMenuKey === menuKey || !visible && isActive,
32724
32614
  content: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "text-xs font-medium", children: `${t("tableMenu.dragColumn")} ${columnHandle.index + 1}` }),
32725
32615
  children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
32726
32616
  DropdownMenu,
@@ -32757,16 +32647,15 @@ function TableControls({ editor, containerRef }) {
32757
32647
  document.body.style.cursor = "grabbing";
32758
32648
  },
32759
32649
  className: cn(
32760
- "inline-flex h-6 w-6 items-center justify-center rounded-full",
32761
- "border border-border/70 bg-background/95 text-muted-foreground shadow-sm backdrop-blur",
32762
- "cursor-grab active:cursor-grabbing",
32763
- "transition-[opacity,transform,colors] duration-150 hover:bg-accent hover:text-foreground"
32650
+ "inline-flex h-6 w-6 items-center justify-center rounded-full transition-[opacity,transform,colors,border,background-color] duration-150",
32651
+ visible ? "border border-border/70 bg-background/95 text-muted-foreground shadow-sm backdrop-blur hover:bg-accent hover:text-foreground cursor-grab active:cursor-grabbing" : "border-transparent bg-transparent cursor-pointer"
32764
32652
  ),
32765
32653
  style: {
32766
- opacity: visible ? 1 : Number(IDLE_HANDLE_OPACITY),
32767
- transform: visible ? "scale(1)" : `scale(${IDLE_HANDLE_SCALE})`
32654
+ opacity: isShown ? 1 : 0,
32655
+ transform: isShown ? "scale(1)" : `scale(${IDLE_HANDLE_SCALE})`,
32656
+ pointerEvents: isShown ? "auto" : "none"
32768
32657
  },
32769
- children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react46.GripHorizontal, { className: "h-3.5 w-3.5" })
32658
+ children: visible ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react46.GripHorizontal, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "h-1 w-3 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
32770
32659
  }
32771
32660
  )
32772
32661
  }
@@ -32814,8 +32703,9 @@ function TableControls({ editor, containerRef }) {
32814
32703
  "transition-[opacity,transform,colors] duration-150 hover:bg-accent hover:text-foreground"
32815
32704
  ),
32816
32705
  style: {
32817
- opacity: controlsVisible || hoverState.menuVisible || tableMenuOpen ? 1 : 0.5,
32818
- transform: controlsVisible || hoverState.menuVisible || tableMenuOpen ? "scale(1)" : "scale(0.82)"
32706
+ opacity: controlsVisible || hoverState.menuVisible || tableMenuOpen ? 1 : 0,
32707
+ transform: controlsVisible || hoverState.menuVisible || tableMenuOpen ? "scale(1)" : "scale(0.82)",
32708
+ pointerEvents: controlsVisible || hoverState.menuVisible || tableMenuOpen ? "auto" : "none"
32819
32709
  },
32820
32710
  children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react46.MoreHorizontal, { className: "h-4 w-4" })
32821
32711
  }
@@ -32857,8 +32747,9 @@ function TableControls({ editor, containerRef }) {
32857
32747
  left: columnRailLeft,
32858
32748
  width: controlsVisible || hoverState.addColumnVisible ? 18 : 12,
32859
32749
  height: controlsVisible || hoverState.addColumnVisible ? visibleTableHeight : 48,
32860
- opacity: controlsVisible || hoverState.addColumnVisible ? 1 : 0.45,
32861
- transform: controlsVisible || hoverState.addColumnVisible ? "scale(1)" : "scale(0.92)"
32750
+ opacity: controlsVisible || hoverState.addColumnVisible ? 1 : 0,
32751
+ transform: controlsVisible || hoverState.addColumnVisible ? "scale(1)" : "scale(0.92)",
32752
+ pointerEvents: controlsVisible || hoverState.addColumnVisible ? "auto" : "none"
32862
32753
  },
32863
32754
  children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "text-sm font-medium leading-none", children: "+" })
32864
32755
  }
@@ -32896,8 +32787,9 @@ function TableControls({ editor, containerRef }) {
32896
32787
  left: controlsVisible || hoverState.addRowVisible ? rowRailLeft : rowRailLeft + Math.max(0, visibleTableWidth / 2 - 24),
32897
32788
  width: controlsVisible || hoverState.addRowVisible ? visibleTableWidth : 48,
32898
32789
  height: controlsVisible || hoverState.addRowVisible ? 16 : 12,
32899
- opacity: controlsVisible || hoverState.addRowVisible ? 1 : 0.45,
32900
- transform: controlsVisible || hoverState.addRowVisible ? "scale(1)" : "scale(0.92)"
32790
+ opacity: controlsVisible || hoverState.addRowVisible ? 1 : 0,
32791
+ transform: controlsVisible || hoverState.addRowVisible ? "scale(1)" : "scale(0.92)",
32792
+ pointerEvents: controlsVisible || hoverState.addRowVisible ? "auto" : "none"
32901
32793
  },
32902
32794
  children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "text-sm font-medium leading-none", children: "+" })
32903
32795
  }