@underverse-ui/underverse 1.0.104 → 1.0.106

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
@@ -6082,11 +6082,21 @@ var Sheet = ({
6082
6082
  closeOnEscape = true,
6083
6083
  header,
6084
6084
  footer,
6085
- overlayOpacity
6085
+ overlayOpacity,
6086
+ resizable = false,
6087
+ minSize = 280,
6088
+ maxSize,
6089
+ onResize
6086
6090
  }) => {
6087
6091
  const [mounted, setMounted] = React19.useState(false);
6088
6092
  const [isAnimating, setIsAnimating] = React19.useState(true);
6089
6093
  const [isVisible, setIsVisible] = React19.useState(false);
6094
+ const [isResizing, setIsResizing] = React19.useState(false);
6095
+ const [sheetSize, setSheetSize] = React19.useState(null);
6096
+ const sheetRef = React19.useRef(null);
6097
+ const resizeStateRef = React19.useRef(null);
6098
+ const isHorizontalSheet = side === "left" || side === "right";
6099
+ const canResize = resizable && size !== "full";
6090
6100
  React19.useEffect(() => {
6091
6101
  setMounted(true);
6092
6102
  }, []);
@@ -6133,6 +6143,68 @@ var Sheet = ({
6133
6143
  const handleClose = () => {
6134
6144
  onOpenChange(false);
6135
6145
  };
6146
+ const clampResizeSize = React19.useCallback((nextSize) => {
6147
+ const viewportSize = isHorizontalSheet ? window.innerWidth : window.innerHeight;
6148
+ const resolvedMaxSize = maxSize ?? Math.round(viewportSize * 0.9);
6149
+ return Math.min(Math.max(nextSize, minSize), resolvedMaxSize);
6150
+ }, [isHorizontalSheet, maxSize, minSize]);
6151
+ const endResize = React19.useCallback(() => {
6152
+ if (!resizeStateRef.current) return;
6153
+ resizeStateRef.current = null;
6154
+ setIsResizing(false);
6155
+ document.body.style.cursor = "";
6156
+ document.body.style.userSelect = "";
6157
+ }, []);
6158
+ const handleResizePointerMove = React19.useCallback((event) => {
6159
+ const resizeState = resizeStateRef.current;
6160
+ if (!resizeState || event.pointerId !== resizeState.pointerId) return;
6161
+ const delta = isHorizontalSheet ? side === "right" ? resizeState.startClientX - event.clientX : event.clientX - resizeState.startClientX : side === "bottom" ? resizeState.startClientY - event.clientY : event.clientY - resizeState.startClientY;
6162
+ const nextSize = clampResizeSize(Math.round(resizeState.startSize + delta));
6163
+ setSheetSize(nextSize);
6164
+ onResize?.(nextSize);
6165
+ }, [clampResizeSize, isHorizontalSheet, onResize, side]);
6166
+ const handleResizePointerUp = React19.useCallback((event) => {
6167
+ const resizeState = resizeStateRef.current;
6168
+ if (!resizeState || event.pointerId !== resizeState.pointerId) return;
6169
+ endResize();
6170
+ }, [endResize]);
6171
+ React19.useEffect(() => {
6172
+ if (!isResizing) return void 0;
6173
+ window.addEventListener("pointermove", handleResizePointerMove);
6174
+ window.addEventListener("pointerup", handleResizePointerUp);
6175
+ window.addEventListener("pointercancel", handleResizePointerUp);
6176
+ return () => {
6177
+ window.removeEventListener("pointermove", handleResizePointerMove);
6178
+ window.removeEventListener("pointerup", handleResizePointerUp);
6179
+ window.removeEventListener("pointercancel", handleResizePointerUp);
6180
+ };
6181
+ }, [handleResizePointerMove, handleResizePointerUp, isResizing]);
6182
+ React19.useEffect(() => {
6183
+ if (!open) endResize();
6184
+ }, [endResize, open]);
6185
+ React19.useEffect(() => endResize, [endResize]);
6186
+ const handleResizePointerDown = (event) => {
6187
+ if (!canResize || !sheetRef.current) return;
6188
+ const rect = sheetRef.current.getBoundingClientRect();
6189
+ const startSize = isHorizontalSheet ? rect.width : rect.height;
6190
+ resizeStateRef.current = {
6191
+ pointerId: event.pointerId,
6192
+ startClientX: event.clientX,
6193
+ startClientY: event.clientY,
6194
+ startSize
6195
+ };
6196
+ setIsResizing(true);
6197
+ event.currentTarget.setPointerCapture(event.pointerId);
6198
+ document.body.style.cursor = isHorizontalSheet ? "col-resize" : "row-resize";
6199
+ document.body.style.userSelect = "none";
6200
+ event.preventDefault();
6201
+ event.stopPropagation();
6202
+ };
6203
+ const sheetInlineStyle = {
6204
+ transform: open && !isAnimating ? "translate(0, 0)" : side === "right" ? "translateX(100%)" : side === "left" ? "translateX(-100%)" : side === "top" ? "translateY(-100%)" : "translateY(100%)",
6205
+ transition: "transform 300ms cubic-bezier(0.4, 0, 0.2, 1)",
6206
+ ...sheetSize !== null ? isHorizontalSheet ? { width: `${sheetSize}px` } : { height: `${sheetSize}px` } : {}
6207
+ };
6136
6208
  if (!mounted || !open && !isVisible) return null;
6137
6209
  const sheetContent = /* @__PURE__ */ jsxs16("div", { className: "fixed inset-0 z-50", children: [
6138
6210
  /* @__PURE__ */ jsx23(
@@ -6150,6 +6222,7 @@ var Sheet = ({
6150
6222
  /* @__PURE__ */ jsxs16(
6151
6223
  "div",
6152
6224
  {
6225
+ ref: sheetRef,
6153
6226
  className: cn(
6154
6227
  "fixed flex flex-col bg-background text-foreground shadow-2xl",
6155
6228
  "border-border/50 transition-all duration-300 ease-out",
@@ -6164,11 +6237,28 @@ var Sheet = ({
6164
6237
  open && !isAnimating ? animationStyles[side].animate : animationStyles[side].initial,
6165
6238
  className
6166
6239
  ),
6167
- style: {
6168
- transform: open && !isAnimating ? "translate(0, 0)" : side === "right" ? "translateX(100%)" : side === "left" ? "translateX(-100%)" : side === "top" ? "translateY(-100%)" : "translateY(100%)",
6169
- transition: "transform 300ms cubic-bezier(0.4, 0, 0.2, 1)"
6170
- },
6240
+ style: sheetInlineStyle,
6171
6241
  children: [
6242
+ canResize && /* @__PURE__ */ jsx23(
6243
+ "button",
6244
+ {
6245
+ type: "button",
6246
+ "aria-label": "Resize sheet",
6247
+ className: cn(
6248
+ "absolute z-10 bg-transparent outline-none transition-colors",
6249
+ "after:absolute after:rounded-full after:bg-border after:opacity-0 after:transition-opacity hover:after:opacity-100 focus-visible:after:opacity-100",
6250
+ isHorizontalSheet ? "top-0 h-full w-3 cursor-col-resize after:top-1/2 after:h-12 after:w-1 after:-translate-y-1/2" : "left-0 h-3 w-full cursor-row-resize after:left-1/2 after:h-1 after:w-12 after:-translate-x-1/2",
6251
+ side === "right" && "-left-1.5 after:left-1/2",
6252
+ side === "left" && "-right-1.5 after:right-1/2",
6253
+ side === "bottom" && "-top-1.5 after:top-1/2",
6254
+ side === "top" && "-bottom-1.5 after:bottom-1/2"
6255
+ ),
6256
+ onPointerDown: handleResizePointerDown,
6257
+ onPointerMove: (event) => handleResizePointerMove(event.nativeEvent),
6258
+ onPointerUp: (event) => handleResizePointerUp(event.nativeEvent),
6259
+ onPointerCancel: (event) => handleResizePointerUp(event.nativeEvent)
6260
+ }
6261
+ ),
6172
6262
  (title || description || header || showClose) && /* @__PURE__ */ jsx23("div", { className: "shrink-0 border-b border-border/50", children: header || /* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between p-4", children: [
6173
6263
  /* @__PURE__ */ jsxs16("div", { className: "flex-1", children: [
6174
6264
  title && /* @__PURE__ */ jsx23("h2", { className: "text-lg font-semibold text-foreground", children: title }),
@@ -7925,7 +8015,7 @@ Section.displayName = "Section";
7925
8015
  var Section_default = Section;
7926
8016
 
7927
8017
  // src/components/ScrollArea.tsx
7928
- import { forwardRef as forwardRef7, useRef as useRef11 } from "react";
8018
+ import { forwardRef as forwardRef7, useRef as useRef12 } from "react";
7929
8019
  import { jsx as jsx32 } from "react/jsx-runtime";
7930
8020
  var variantClasses2 = {
7931
8021
  default: "bg-background",
@@ -7944,7 +8034,7 @@ var ScrollArea = forwardRef7(
7944
8034
  useOverlayScrollbar = false,
7945
8035
  ...props
7946
8036
  }, ref) => {
7947
- const viewportRef = useRef11(null);
8037
+ const viewportRef = useRef12(null);
7948
8038
  useOverlayScrollbarTarget(viewportRef, { enabled: useOverlayScrollbar });
7949
8039
  return /* @__PURE__ */ jsx32(
7950
8040
  "div",
@@ -7960,11 +8050,11 @@ var ScrollArea = forwardRef7(
7960
8050
  ScrollArea.displayName = "ScrollArea";
7961
8051
 
7962
8052
  // src/components/OverlayScrollArea.tsx
7963
- import { forwardRef as forwardRef8, useRef as useRef12 } from "react";
8053
+ import { forwardRef as forwardRef8, useRef as useRef13 } from "react";
7964
8054
  import { jsx as jsx33 } from "react/jsx-runtime";
7965
8055
  var OverlayScrollArea = forwardRef8(
7966
8056
  ({ className, viewportClassName, viewportProps, enabled = true, overflowHidden = true, overlayScrollbarOptions, children, ...props }, ref) => {
7967
- const viewportRef = useRef12(null);
8057
+ const viewportRef = useRef13(null);
7968
8058
  useOverlayScrollbarTarget(viewportRef, {
7969
8059
  enabled,
7970
8060
  ...overlayScrollbarOptions
@@ -16942,7 +17032,7 @@ function OverlayControls({
16942
17032
  }
16943
17033
 
16944
17034
  // src/components/CategoryTreeSelect.tsx
16945
- import { useEffect as useEffect25, useId as useId11, useMemo as useMemo19, useRef as useRef19, useState as useState31 } from "react";
17035
+ import { useEffect as useEffect25, useId as useId11, useMemo as useMemo19, useRef as useRef20, useState as useState31 } from "react";
16946
17036
  import { ChevronRight as ChevronRight6, ChevronDown as ChevronDown5, FolderTree, Layers, Search as Search6, SearchX as SearchX3, X as X14 } from "lucide-react";
16947
17037
  import { jsx as jsx49, jsxs as jsxs39 } from "react/jsx-runtime";
16948
17038
  var defaultLabels = {
@@ -17070,8 +17160,8 @@ function CategoryTreeSelect(props) {
17070
17160
  );
17071
17161
  const [query, setQuery] = useState31("");
17072
17162
  const [localRequiredError, setLocalRequiredError] = useState31();
17073
- const searchInputRef = useRef19(null);
17074
- const dropdownViewportRef = useRef19(null);
17163
+ const searchInputRef = useRef20(null);
17164
+ const dropdownViewportRef = useRef20(null);
17075
17165
  useOverlayScrollbarTarget(dropdownViewportRef, { enabled: useOverlayScrollbar });
17076
17166
  const autoId = useId11();
17077
17167
  const resolvedId = id ? String(id) : `category-tree-select-${autoId}`;
@@ -17642,7 +17732,7 @@ function CategoryTreeSelect(props) {
17642
17732
  }
17643
17733
 
17644
17734
  // src/components/ImageUpload.tsx
17645
- import { useState as useState32, useRef as useRef20, useCallback as useCallback15 } from "react";
17735
+ import { useState as useState32, useRef as useRef21, useCallback as useCallback16 } from "react";
17646
17736
  import { Upload, X as X15, Image as ImageIcon, Loader2 as Loader25, Check as Check7 } from "lucide-react";
17647
17737
  import { jsx as jsx50, jsxs as jsxs40 } from "react/jsx-runtime";
17648
17738
  function ImageUpload({
@@ -17663,7 +17753,7 @@ function ImageUpload({
17663
17753
  const [isDragging, setIsDragging] = useState32(false);
17664
17754
  const [uploading, setUploading] = useState32(false);
17665
17755
  const [uploadedImages, setUploadedImages] = useState32([]);
17666
- const fileInputRef = useRef20(null);
17756
+ const fileInputRef = useRef21(null);
17667
17757
  const { addToast } = useToast();
17668
17758
  const t = useSmartTranslations("OCR.imageUpload");
17669
17759
  const previewSizes = {
@@ -17671,7 +17761,7 @@ function ImageUpload({
17671
17761
  md: "w-24 h-24",
17672
17762
  lg: "w-32 h-32"
17673
17763
  };
17674
- const handleDragOver = useCallback15(
17764
+ const handleDragOver = useCallback16(
17675
17765
  (e) => {
17676
17766
  e.preventDefault();
17677
17767
  if (!disabled) {
@@ -17680,11 +17770,11 @@ function ImageUpload({
17680
17770
  },
17681
17771
  [disabled]
17682
17772
  );
17683
- const handleDragLeave = useCallback15((e) => {
17773
+ const handleDragLeave = useCallback16((e) => {
17684
17774
  e.preventDefault();
17685
17775
  setIsDragging(false);
17686
17776
  }, []);
17687
- const handleFiles = useCallback15(
17777
+ const handleFiles = useCallback16(
17688
17778
  async (files) => {
17689
17779
  if (files.length === 0) return;
17690
17780
  const validFiles = files.filter((file) => {
@@ -17751,7 +17841,7 @@ function ImageUpload({
17751
17841
  },
17752
17842
  [maxSize, addToast, onUpload]
17753
17843
  );
17754
- const handleDrop = useCallback15(
17844
+ const handleDrop = useCallback16(
17755
17845
  (e) => {
17756
17846
  e.preventDefault();
17757
17847
  setIsDragging(false);
@@ -17761,7 +17851,7 @@ function ImageUpload({
17761
17851
  },
17762
17852
  [disabled, handleFiles]
17763
17853
  );
17764
- const handleFileSelect = useCallback15(
17854
+ const handleFileSelect = useCallback16(
17765
17855
  (e) => {
17766
17856
  const files = Array.from(e.target.files || []);
17767
17857
  handleFiles(files);
@@ -17881,7 +17971,7 @@ import {
17881
17971
  Trash2,
17882
17972
  Upload as Upload2
17883
17973
  } from "lucide-react";
17884
- import { useCallback as useCallback16, useMemo as useMemo20, useRef as useRef21, useState as useState33 } from "react";
17974
+ import { useCallback as useCallback17, useMemo as useMemo20, useRef as useRef22, useState as useState33 } from "react";
17885
17975
  import { Fragment as Fragment16, jsx as jsx51, jsxs as jsxs41 } from "react/jsx-runtime";
17886
17976
  var formatFileSize = (bytes) => {
17887
17977
  if (bytes === 0) return "0 Bytes";
@@ -17990,7 +18080,7 @@ function FileUpload({
17990
18080
  }) {
17991
18081
  const [isDragging, setIsDragging] = useState33(false);
17992
18082
  const [files, setFiles] = useState33(initialFiles);
17993
- const fileInputRef = useRef21(null);
18083
+ const fileInputRef = useRef22(null);
17994
18084
  const { addToast } = useToast();
17995
18085
  const t = useSmartTranslations("FileUpload");
17996
18086
  const sizeConfig = useMemo20(
@@ -18026,7 +18116,7 @@ function FileUpload({
18026
18116
  []
18027
18117
  );
18028
18118
  const currentSize = sizeConfig[size];
18029
- const handleDragOver = useCallback16(
18119
+ const handleDragOver = useCallback17(
18030
18120
  (e) => {
18031
18121
  e.preventDefault();
18032
18122
  e.stopPropagation();
@@ -18036,12 +18126,12 @@ function FileUpload({
18036
18126
  },
18037
18127
  [disabled]
18038
18128
  );
18039
- const handleDragLeave = useCallback16((e) => {
18129
+ const handleDragLeave = useCallback17((e) => {
18040
18130
  e.preventDefault();
18041
18131
  e.stopPropagation();
18042
18132
  setIsDragging(false);
18043
18133
  }, []);
18044
- const processFiles = useCallback16(
18134
+ const processFiles = useCallback17(
18045
18135
  async (fileList) => {
18046
18136
  if (fileList.length === 0) return;
18047
18137
  const remainingSlots = maxFiles - files.length;
@@ -18114,7 +18204,7 @@ function FileUpload({
18114
18204
  },
18115
18205
  [files, maxFiles, maxSize, uploadHandler, onUpload, onChange, addToast, t]
18116
18206
  );
18117
- const handleDrop = useCallback16(
18207
+ const handleDrop = useCallback17(
18118
18208
  (e) => {
18119
18209
  e.preventDefault();
18120
18210
  e.stopPropagation();
@@ -18125,7 +18215,7 @@ function FileUpload({
18125
18215
  },
18126
18216
  [disabled, processFiles]
18127
18217
  );
18128
- const handleFileSelect = useCallback16(
18218
+ const handleFileSelect = useCallback17(
18129
18219
  (e) => {
18130
18220
  const selectedFiles = Array.from(e.target.files || []);
18131
18221
  processFiles(selectedFiles);
@@ -18135,7 +18225,7 @@ function FileUpload({
18135
18225
  },
18136
18226
  [processFiles]
18137
18227
  );
18138
- const handleRemove = useCallback16(
18228
+ const handleRemove = useCallback17(
18139
18229
  (fileId) => {
18140
18230
  setFiles((prev) => {
18141
18231
  const fileToRemove = prev.find((f) => f.id === fileId);
@@ -18153,7 +18243,7 @@ function FileUpload({
18153
18243
  const handleBrowseClick = () => {
18154
18244
  fileInputRef.current?.click();
18155
18245
  };
18156
- const handleRetry = useCallback16(
18246
+ const handleRetry = useCallback17(
18157
18247
  (fileEntry) => {
18158
18248
  if (!uploadHandler || !fileEntry.file) return;
18159
18249
  processFiles([fileEntry.file]);
@@ -20481,7 +20571,7 @@ function ColorPicker({
20481
20571
  }
20482
20572
 
20483
20573
  // src/components/MusicPlayer.tsx
20484
- import { useState as useState39, useRef as useRef23, useEffect as useEffect29 } from "react";
20574
+ import { useState as useState39, useRef as useRef24, useEffect as useEffect29 } from "react";
20485
20575
  import { Play as Play2, Pause as Pause2, SkipForward, SkipBack, Volume2 as Volume22, VolumeX as VolumeX2, List as List2, X as X17 } from "lucide-react";
20486
20576
  import { jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
20487
20577
  var DEFAULT_PLAYLIST = [
@@ -20610,7 +20700,7 @@ var MusicPlayer = ({
20610
20700
  const [volume, setVolume] = useState39(1);
20611
20701
  const [isMuted, setIsMuted] = useState39(false);
20612
20702
  const [showPlaylist, setShowPlaylist] = useState39(initialShowPlaylist);
20613
- const audioRef = useRef23(null);
20703
+ const audioRef = useRef24(null);
20614
20704
  const currentSong = playlist[currentSongIndex];
20615
20705
  useEffect29(() => {
20616
20706
  if (audioRef.current) {
@@ -21371,6 +21461,7 @@ function DataTableHeader({
21371
21461
  enableHeaderAutoFit,
21372
21462
  getStickyHeaderClass,
21373
21463
  getStickyHeaderCellStyle,
21464
+ sortByLabel,
21374
21465
  t
21375
21466
  }) {
21376
21467
  const renderFilterControl = React54.useCallback(
@@ -21447,18 +21538,20 @@ function DataTableHeader({
21447
21538
  const isRightAlign = col.align === "right" || !col.align && headerAlign === "right";
21448
21539
  const isCenterAlign = col.align === "center" || !col.align && headerAlign === "center";
21449
21540
  const columnLabel = getColumnLabel(col.title) || col.key;
21541
+ const sortByText = sortByLabel ?? "Sort by";
21542
+ const sortLabel = `${sortByText} ${columnLabel}`;
21450
21543
  const titleContent = /* @__PURE__ */ jsxs53("div", { className: "flex items-center gap-1", children: [
21451
21544
  /* @__PURE__ */ jsx64("span", { className: cn("font-medium whitespace-nowrap select-text", headerTitleClass), children: col.title }),
21452
21545
  col.sortable && /* @__PURE__ */ jsx64(
21453
21546
  Tooltip,
21454
21547
  {
21455
21548
  placement: "top",
21456
- content: /* @__PURE__ */ jsx64("span", { className: "text-xs font-medium", children: `Sort by ${columnLabel}` }),
21549
+ content: /* @__PURE__ */ jsx64("span", { className: "text-xs font-medium", children: sortLabel }),
21457
21550
  children: /* @__PURE__ */ jsx64(
21458
21551
  "button",
21459
21552
  {
21460
21553
  type: "button",
21461
- title: `Sort by ${columnLabel}`,
21554
+ title: sortLabel,
21462
21555
  className: cn(
21463
21556
  "p-1 rounded-lg transition-all duration-200 hover:bg-accent",
21464
21557
  sort?.key === col.key ? "opacity-100 bg-accent" : "opacity-60 hover:opacity-100"
@@ -21471,7 +21564,7 @@ function DataTableHeader({
21471
21564
  return null;
21472
21565
  });
21473
21566
  },
21474
- "aria-label": `Sort by ${columnLabel}`,
21567
+ "aria-label": sortLabel,
21475
21568
  children: /* @__PURE__ */ jsxs53("svg", { viewBox: "0 0 20 20", fill: "none", className: cn("inline-block", sortIconClass), children: [
21476
21569
  /* @__PURE__ */ jsx64(
21477
21570
  "path",
@@ -22578,6 +22671,7 @@ function DataTable({
22578
22671
  enableHeaderAutoFit,
22579
22672
  getStickyHeaderClass,
22580
22673
  getStickyHeaderCellStyle,
22674
+ sortByLabel: labels?.sortBy,
22581
22675
  t
22582
22676
  }
22583
22677
  ) }),
@@ -22859,7 +22953,7 @@ function AccessDenied({
22859
22953
 
22860
22954
  // src/components/ThemeToggleHeadless.tsx
22861
22955
  import { Moon as Moon2, Sun as Sun2, Monitor } from "lucide-react";
22862
- import { useRef as useRef24, useState as useState40 } from "react";
22956
+ import { useRef as useRef25, useState as useState40 } from "react";
22863
22957
  import { createPortal as createPortal6 } from "react-dom";
22864
22958
  import { Fragment as Fragment23, jsx as jsx71, jsxs as jsxs60 } from "react/jsx-runtime";
22865
22959
  function ThemeToggleHeadless({
@@ -22870,7 +22964,7 @@ function ThemeToggleHeadless({
22870
22964
  }) {
22871
22965
  const [isOpen, setIsOpen] = useState40(false);
22872
22966
  const isHydrated = useHydrated();
22873
- const triggerRef = useRef24(null);
22967
+ const triggerRef = useRef25(null);
22874
22968
  const [dropdownPosition, setDropdownPosition] = useState40(null);
22875
22969
  const themes = [
22876
22970
  { value: "light", label: labels?.light ?? "Light", icon: Sun2 },
@@ -22960,7 +23054,7 @@ function ThemeToggleHeadless({
22960
23054
  }
22961
23055
 
22962
23056
  // src/components/LanguageSwitcherHeadless.tsx
22963
- import { useRef as useRef25, useState as useState41 } from "react";
23057
+ import { useRef as useRef26, useState as useState41 } from "react";
22964
23058
  import { createPortal as createPortal7 } from "react-dom";
22965
23059
  import { Globe } from "lucide-react";
22966
23060
  import { Fragment as Fragment24, jsx as jsx72, jsxs as jsxs61 } from "react/jsx-runtime";
@@ -22973,7 +23067,7 @@ function LanguageSwitcherHeadless({
22973
23067
  }) {
22974
23068
  const [isOpen, setIsOpen] = useState41(false);
22975
23069
  const [dropdownPosition, setDropdownPosition] = useState41(null);
22976
- const triggerButtonRef = useRef25(null);
23070
+ const triggerButtonRef = useRef26(null);
22977
23071
  const currentLanguage = locales.find((l) => l.code === currentLocale) || locales[0];
22978
23072
  const calculatePosition = () => {
22979
23073
  const rect = triggerButtonRef.current?.getBoundingClientRect();
@@ -23109,7 +23203,7 @@ function useLocale2() {
23109
23203
  }
23110
23204
 
23111
23205
  // src/components/UEditor/UEditor.tsx
23112
- import React76, { useEffect as useEffect36, useImperativeHandle as useImperativeHandle3, useMemo as useMemo24, useRef as useRef33 } from "react";
23206
+ import React76, { useEffect as useEffect36, useImperativeHandle as useImperativeHandle3, useMemo as useMemo24, useRef as useRef34 } from "react";
23113
23207
  import { useEditor, EditorContent } from "@tiptap/react";
23114
23208
 
23115
23209
  // src/components/UEditor/extensions.ts
@@ -23148,7 +23242,7 @@ import { common, createLowlight } from "lowlight";
23148
23242
  import { Extension } from "@tiptap/core";
23149
23243
  import Suggestion from "@tiptap/suggestion";
23150
23244
  import { ReactRenderer } from "@tiptap/react";
23151
- import React66, { forwardRef as forwardRef14, useEffect as useEffect31, useImperativeHandle, useRef as useRef26 } from "react";
23245
+ import React66, { forwardRef as forwardRef14, useEffect as useEffect31, useImperativeHandle, useRef as useRef27 } from "react";
23152
23246
  import {
23153
23247
  FileCode as FileCode2,
23154
23248
  Heading1,
@@ -23354,7 +23448,7 @@ function buildSlashCommandItems({
23354
23448
  }
23355
23449
  var SlashCommandList = forwardRef14((props, ref) => {
23356
23450
  const [selectedIndex, setSelectedIndex] = useResettingIndex2(props.items);
23357
- const listRef = useRef26(null);
23451
+ const listRef = useRef27(null);
23358
23452
  useEffect31(() => {
23359
23453
  const selectedElement = listRef.current?.querySelector(`[data-index="${selectedIndex}"]`);
23360
23454
  selectedElement?.scrollIntoView({ block: "nearest" });
@@ -23856,7 +23950,7 @@ var UEditorPlaceholder = Extension4.create({
23856
23950
  });
23857
23951
 
23858
23952
  // src/components/UEditor/resizable-image.tsx
23859
- import { useEffect as useEffect32, useRef as useRef27, useState as useState42 } from "react";
23953
+ import { useEffect as useEffect32, useRef as useRef28, useState as useState42 } from "react";
23860
23954
  import Image3 from "@tiptap/extension-image";
23861
23955
  import { mergeAttributes } from "@tiptap/core";
23862
23956
  import { NodeViewWrapper, ReactNodeViewRenderer } from "@tiptap/react";
@@ -23905,8 +23999,8 @@ function getImageLayoutStyles(layout) {
23905
23999
  }
23906
24000
  function ResizableImageNodeView(props) {
23907
24001
  const { node, selected, updateAttributes, editor, getPos } = props;
23908
- const wrapperRef = useRef27(null);
23909
- const imgRef = useRef27(null);
24002
+ const wrapperRef = useRef28(null);
24003
+ const imgRef = useRef28(null);
23910
24004
  const [isHovered, setIsHovered] = useState42(false);
23911
24005
  const [isResizing, setIsResizing] = useState42(false);
23912
24006
  const widthAttr = toNullableNumber(node.attrs["width"]);
@@ -23914,7 +24008,7 @@ function ResizableImageNodeView(props) {
23914
24008
  const textAlign = String(node.attrs["textAlign"] ?? "");
23915
24009
  const imageLayout = parseImageLayout(node.attrs["imageLayout"]);
23916
24010
  const preserveAspectByDefault = imageLayout === "left" || imageLayout === "right";
23917
- const dragStateRef = useRef27(null);
24011
+ const dragStateRef = useRef28(null);
23918
24012
  useEffect32(() => {
23919
24013
  const img = imgRef.current;
23920
24014
  if (!img) return;
@@ -24571,7 +24665,7 @@ function buildUEditorExtensions({
24571
24665
  }
24572
24666
 
24573
24667
  // src/components/UEditor/toolbar.tsx
24574
- import React71, { useRef as useRef29, useState as useState44 } from "react";
24668
+ import React71, { useRef as useRef30, useState as useState44 } from "react";
24575
24669
  import {
24576
24670
  AlignCenter,
24577
24671
  AlignJustify,
@@ -24763,7 +24857,7 @@ function deleteSelectedImage(editor) {
24763
24857
  }
24764
24858
 
24765
24859
  // src/components/UEditor/inputs.tsx
24766
- import { useEffect as useEffect33, useRef as useRef28, useState as useState43 } from "react";
24860
+ import { useEffect as useEffect33, useRef as useRef29, useState as useState43 } from "react";
24767
24861
  import { Check as Check10, X as X19 } from "lucide-react";
24768
24862
  import { jsx as jsx78, jsxs as jsxs66 } from "react/jsx-runtime";
24769
24863
  function normalizeUrl(raw) {
@@ -24776,7 +24870,7 @@ var LinkInput = ({
24776
24870
  }) => {
24777
24871
  const t = useSmartTranslations("UEditor");
24778
24872
  const [url, setUrl] = useState43(initialUrl);
24779
- const inputRef = useRef28(null);
24873
+ const inputRef = useRef29(null);
24780
24874
  useEffect33(() => {
24781
24875
  inputRef.current?.focus();
24782
24876
  inputRef.current?.select();
@@ -24806,7 +24900,7 @@ var ImageInput = ({ onSubmit, onCancel }) => {
24806
24900
  const t = useSmartTranslations("UEditor");
24807
24901
  const [url, setUrl] = useState43("");
24808
24902
  const [alt, setAlt] = useState43("");
24809
- const inputRef = useRef28(null);
24903
+ const inputRef = useRef29(null);
24810
24904
  useEffect33(() => {
24811
24905
  inputRef.current?.focus();
24812
24906
  }, []);
@@ -25011,8 +25105,8 @@ var EditorToolbar = ({
25011
25105
  const { textColors, highlightColors } = useEditorColors();
25012
25106
  const [showImageInput, setShowImageInput] = useState44(false);
25013
25107
  const [isTableMenuOpen, setIsTableMenuOpen] = useState44(false);
25014
- const tableCommandAnchorPosRef = useRef29(null);
25015
- const fileInputRef = useRef29(null);
25108
+ const tableCommandAnchorPosRef = useRef30(null);
25109
+ const fileInputRef = useRef30(null);
25016
25110
  const [isUploadingImage, setIsUploadingImage] = useState44(false);
25017
25111
  const [imageUploadError, setImageUploadError] = useState44(null);
25018
25112
  const [fontSizeDraft, setFontSizeDraft] = useState44("");
@@ -25830,7 +25924,7 @@ var EditorToolbar = ({
25830
25924
  };
25831
25925
 
25832
25926
  // src/components/UEditor/menus.tsx
25833
- import { useCallback as useCallback19, useEffect as useEffect34, useMemo as useMemo23, useRef as useRef30, useState as useState45 } from "react";
25927
+ import { useCallback as useCallback20, useEffect as useEffect34, useMemo as useMemo23, useRef as useRef31, useState as useState45 } from "react";
25834
25928
  import { createPortal as createPortal8 } from "react-dom";
25835
25929
  import {
25836
25930
  AlignCenter as AlignCenter2,
@@ -25854,7 +25948,7 @@ var FloatingSlashCommandMenu = ({ editor, onClose }) => {
25854
25948
  const t = useSmartTranslations("UEditor");
25855
25949
  const messages = useMemo23(() => buildSlashCommandMessages(t), [t]);
25856
25950
  const items = useMemo23(() => buildSlashCommandItems({ query: "", messages }), [messages]);
25857
- const listRef = useRef30(null);
25951
+ const listRef = useRef31(null);
25858
25952
  useEffect34(() => {
25859
25953
  const handleKeyDown2 = (event) => {
25860
25954
  if (event.key === "Escape") {
@@ -26119,10 +26213,10 @@ var CustomBubbleMenu = ({
26119
26213
  const BUBBLE_MENU_OFFSET = 16;
26120
26214
  const [isVisible, setIsVisible] = useState45(false);
26121
26215
  const [position, setPosition] = useState45({ top: 0, left: 0 });
26122
- const menuRef = useRef30(null);
26123
- const keepOpenRef = useRef30(false);
26124
- const showTimeoutRef = useRef30(null);
26125
- const setKeepOpen = useCallback19((next) => {
26216
+ const menuRef = useRef31(null);
26217
+ const keepOpenRef = useRef31(false);
26218
+ const showTimeoutRef = useRef31(null);
26219
+ const setKeepOpen = useCallback20((next) => {
26126
26220
  keepOpenRef.current = next;
26127
26221
  if (next) setIsVisible(true);
26128
26222
  }, []);
@@ -31962,10 +32056,10 @@ var UEDITOR_PROSEMIRROR_CLASS_NAME = cn(
31962
32056
  );
31963
32057
 
31964
32058
  // src/components/UEditor/use-table-interactions.ts
31965
- import React75, { useEffect as useEffect35, useRef as useRef32 } from "react";
32059
+ import React75, { useEffect as useEffect35, useRef as useRef33 } from "react";
31966
32060
 
31967
32061
  // src/components/UEditor/use-table-row-resize.ts
31968
- import React74, { useRef as useRef31 } from "react";
32062
+ import React74, { useRef as useRef32 } from "react";
31969
32063
  function useTableRowResize({
31970
32064
  editor,
31971
32065
  setHoveredTableCell,
@@ -31974,8 +32068,8 @@ function useTableRowResize({
31974
32068
  clearAllTableResizeHover,
31975
32069
  scheduleTableLayoutSync
31976
32070
  }) {
31977
- const commitFrameRef = useRef31(null);
31978
- const stateRef = useRef31(null);
32071
+ const commitFrameRef = useRef32(null);
32072
+ const stateRef = useRef32(null);
31979
32073
  const commitPreview = React74.useCallback(() => {
31980
32074
  if (!editor) return;
31981
32075
  const state = stateRef.current;
@@ -32128,14 +32222,14 @@ function useTableRowResize({
32128
32222
 
32129
32223
  // src/components/UEditor/use-table-interactions.ts
32130
32224
  function useUEditorTableInteractions(editor) {
32131
- const editorContentRef = useRef32(null);
32132
- const tableColumnGuideRef = useRef32(null);
32133
- const tableRowGuideRef = useRef32(null);
32134
- const activeTableCellHighlightRef = useRef32(null);
32135
- const hoveredTableCellRef = useRef32(null);
32136
- const activeTableCellRef = useRef32(null);
32137
- const suppressActiveCellHighlightRef = useRef32(false);
32138
- const tableLayoutSyncFrameRef = useRef32(null);
32225
+ const editorContentRef = useRef33(null);
32226
+ const tableColumnGuideRef = useRef33(null);
32227
+ const tableRowGuideRef = useRef33(null);
32228
+ const activeTableCellHighlightRef = useRef33(null);
32229
+ const hoveredTableCellRef = useRef33(null);
32230
+ const activeTableCellRef = useRef33(null);
32231
+ const suppressActiveCellHighlightRef = useRef33(false);
32232
+ const tableLayoutSyncFrameRef = useRef33(null);
32139
32233
  const setEditorResizeCursor = React75.useCallback((cursor) => {
32140
32234
  const proseMirror = editorContentRef.current?.querySelector(".ProseMirror");
32141
32235
  if (proseMirror) {
@@ -32441,8 +32535,8 @@ var UEditor = React76.forwardRef(({
32441
32535
  }, ref) => {
32442
32536
  const t = useSmartTranslations("UEditor");
32443
32537
  const effectivePlaceholder = placeholder ?? t("placeholder");
32444
- const inFlightPrepareRef = useRef33(null);
32445
- const lastAppliedContentRef = useRef33(content ?? "");
32538
+ const inFlightPrepareRef = useRef34(null);
32539
+ const lastAppliedContentRef = useRef34(content ?? "");
32446
32540
  const extensions = useMemo24(
32447
32541
  () => buildUEditorExtensions({
32448
32542
  placeholder: effectivePlaceholder,