@underverse-ui/underverse 1.0.123 → 1.0.124

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
@@ -25213,7 +25213,7 @@ function buildUEditorExtensions({
25213
25213
  types: ["heading", "paragraph", "image"]
25214
25214
  }),
25215
25215
  table_align_default.configure({
25216
- resizable: true,
25216
+ resizable: editable,
25217
25217
  handleWidth: 10,
25218
25218
  allowTableNodeSelection: true,
25219
25219
  HTMLAttributes: {
@@ -32818,7 +32818,7 @@ function useTableRowResize({
32818
32818
  }
32819
32819
 
32820
32820
  // src/components/UEditor/use-table-interactions.ts
32821
- function useUEditorTableInteractions(editor) {
32821
+ function useUEditorTableInteractions(editor, editable = true) {
32822
32822
  const editorContentRef = useRef33(null);
32823
32823
  const tableColumnGuideRef = useRef33(null);
32824
32824
  const tableRowGuideRef = useRef33(null);
@@ -32937,7 +32937,7 @@ function useUEditorTableInteractions(editor) {
32937
32937
  setActiveTableCell(getSelectionTableCell(editor.view));
32938
32938
  }, [editor, setActiveTableCell]);
32939
32939
  useEffect35(() => {
32940
- if (!editor) return void 0;
32940
+ if (!editor || !editable) return void 0;
32941
32941
  const proseMirror = editor.view.dom;
32942
32942
  const surface = editorContentRef.current;
32943
32943
  let selectionSyncTimeoutId = 0;
@@ -33086,7 +33086,7 @@ function useUEditorTableInteractions(editor) {
33086
33086
  clearHoveredTableCell();
33087
33087
  clearAllTableResizeHover();
33088
33088
  };
33089
- }, [beginResize, cancelResize, cleanupRowResize, clearActiveTableCell, clearAllTableResizeHover, clearHoveredTableCell, editor, handleRowResizePointerMove, handleRowResizePointerUp, hideColumnGuide, hideRowGuide, isRowResizing, showColumnGuide, showRowGuide, syncActiveRowResizeGuide, syncActiveTableCellFromSelection, updateActiveCellHighlight]);
33089
+ }, [beginResize, cancelResize, cleanupRowResize, clearActiveTableCell, clearAllTableResizeHover, clearHoveredTableCell, editable, editor, handleRowResizePointerMove, handleRowResizePointerUp, hideColumnGuide, hideRowGuide, isRowResizing, showColumnGuide, showRowGuide, syncActiveRowResizeGuide, syncActiveTableCellFromSelection, updateActiveCellHighlight]);
33090
33090
  return {
33091
33091
  editorContentRef,
33092
33092
  tableColumnGuideRef,
@@ -33189,7 +33189,7 @@ var UEditor = React77.forwardRef(({
33189
33189
  tableColumnGuideRef,
33190
33190
  tableRowGuideRef,
33191
33191
  activeTableCellHighlightRef
33192
- } = useUEditorTableInteractions(editor);
33192
+ } = useUEditorTableInteractions(editor, editable);
33193
33193
  useImperativeHandle3(
33194
33194
  ref,
33195
33195
  () => ({
@@ -33236,11 +33236,14 @@ var UEditor = React77.forwardRef(({
33236
33236
  "div",
33237
33237
  {
33238
33238
  className: cn(
33239
- "group relative flex flex-col rounded-2xl md:rounded-3xl border border-border/50 bg-card text-card-foreground overflow-hidden",
33240
- "transition-[transform,box-shadow,border-color,background-color] duration-300 ease-soft",
33241
- "shadow-sm focus-within:shadow-md focus-within:border-primary/15",
33242
- "backdrop-blur-sm",
33243
- variant === "notion" && "hover:shadow-md",
33239
+ "group relative flex flex-col text-card-foreground",
33240
+ editable ? [
33241
+ "rounded-2xl md:rounded-3xl border border-border/50 bg-card overflow-hidden",
33242
+ "transition-[transform,box-shadow,border-color,background-color] duration-300 ease-soft",
33243
+ "shadow-sm focus-within:shadow-md focus-within:border-primary/15",
33244
+ "backdrop-blur-sm",
33245
+ variant === "notion" && "hover:shadow-md"
33246
+ ] : "rounded-none",
33244
33247
  className
33245
33248
  ),
33246
33249
  children: [
@@ -33274,7 +33277,7 @@ var UEditor = React77.forwardRef(({
33274
33277
  ref: editorContentRef,
33275
33278
  className: "relative flex-1 overflow-y-auto",
33276
33279
  style: {
33277
- minHeight,
33280
+ minHeight: editable ? minHeight : void 0,
33278
33281
  maxHeight
33279
33282
  },
33280
33283
  children: [