Temporarily removed table control bubble

This commit is contained in:
2026-02-28 17:38:43 -06:00
parent 7096f32ea5
commit 8020e16ca1
2 changed files with 49 additions and 23 deletions
+48
View File
@@ -215,6 +215,54 @@ export const getSuggestionItems = ({ query }: { query: string }): CommandItem[]
editor.chain().focus().deleteRange(range).setTextAlign("right").run();
},
},
{
title: "Add Row Above",
description: "Insert a new row above the cursor.",
icon: Grid3X3,
command: ({ editor, range }: { editor: any, range: any }) => {
editor.chain().focus().deleteRange(range).addRowBefore().run();
},
},
{
title: "Add Row Below",
description: "Insert a new row below the cursor.",
icon: Grid3X3,
command: ({ editor, range }: { editor: any, range: any }) => {
editor.chain().focus().deleteRange(range).addRowAfter().run();
},
},
{
title: "Delete Row",
description: "Delete the current row.",
icon: Trash2,
command: ({ editor, range }: { editor: any, range: any }) => {
editor.chain().focus().deleteRange(range).deleteRow().run();
},
},
{
title: "Add Column Left",
description: "Insert a new column to the left.",
icon: Grid3X3,
command: ({ editor, range }: { editor: any, range: any }) => {
editor.chain().focus().deleteRange(range).addColumnBefore().run();
},
},
{
title: "Add Column Right",
description: "Insert a new column to the right.",
icon: Grid3X3,
command: ({ editor, range }: { editor: any, range: any }) => {
editor.chain().focus().deleteRange(range).addColumnAfter().run();
},
},
{
title: "Delete Column",
description: "Delete the current column.",
icon: Trash2,
command: ({ editor, range }: { editor: any, range: any }) => {
editor.chain().focus().deleteRange(range).deleteColumn().run();
},
},
{
title: "Delete Table",
description: "Delete the entire table.",
+1 -23
View File
@@ -6,7 +6,7 @@ import TaskList from "@tiptap/extension-task-list";
import { CustomTaskItem } from "./CustomTaskItem";
import Image from "@tiptap/extension-image";
import Underline from "@tiptap/extension-underline";
import { X, Trash2, ArrowUpToLine, ArrowDownToLine, ArrowLeftToLine, ArrowRightToLine } from "lucide-solid";
import { X } from "lucide-solid";
import { cn } from "@/lib/utils";
import { store } from "@/store";
@@ -24,7 +24,6 @@ import { TableCell } from "@tiptap/extension-table-cell";
import { TableHeader } from "@tiptap/extension-table-header";
import { Typography } from "@tiptap/extension-typography";
import { Dropcursor } from "@tiptap/extension-dropcursor";
import { BubbleMenu } from "@tiptap/extension-bubble-menu";
import { Mention } from "@tiptap/extension-mention";
import { userSuggestion, noteSuggestion } from "@/lib/mention-suggestion";
@@ -40,7 +39,6 @@ interface TaskEditorProps {
export const TaskEditor: Component<TaskEditorProps> = (props) => {
let editorRef: HTMLDivElement | undefined;
let tableMenuRef: HTMLDivElement | undefined;
const [fullscreenImage, setFullscreenImage] = createSignal<string | null>(null);
const [zoomScale, setZoomScale] = createSignal(1);
const [zoomOffset, setZoomOffset] = createSignal({ x: 0, y: 0 });
@@ -157,12 +155,6 @@ export const TaskEditor: Component<TaskEditorProps> = (props) => {
class: "note-mention bg-muted text-muted-foreground font-medium py-0.5 px-1 rounded-md border border-border italic cursor-pointer hover:bg-muted/80",
},
}),
BubbleMenu.configure({
element: tableMenuRef!,
shouldShow: ({ editor }) => editor.isActive("table"),
// @ts-ignore - Solid-tiptap types might be outdated
tippyOptions: { placement: "bottom", duration: 100 },
}),
Dropcursor.configure({
color: "var(--primary)",
width: 2,
@@ -275,20 +267,6 @@ export const TaskEditor: Component<TaskEditorProps> = (props) => {
}}
/>
{/* Table Bubble Menu */}
<div
ref={tableMenuRef}
class="z-[9999] flex p-0.5 bg-background border border-border shadow-md rounded-md gap-0.5 invisible data-[state=visible]:visible"
>
<button type="button" class="p-1 px-1.5 hover:bg-muted rounded text-xs flex flex-col items-center justify-center opacity-80 hover:opacity-100 transition-opacity whitespace-nowrap text-muted-foreground hover:text-foreground" onClick={() => editor()?.chain().focus().addRowBefore().run()} title="Add Row Above"><ArrowUpToLine size={14} /> +Row</button>
<button type="button" class="p-1 px-1.5 hover:bg-muted rounded text-xs flex flex-col items-center justify-center opacity-80 hover:opacity-100 transition-opacity whitespace-nowrap text-muted-foreground hover:text-foreground" onClick={() => editor()?.chain().focus().addRowAfter().run()} title="Add Row Below"><ArrowDownToLine size={14} /> +Row</button>
<button type="button" class="p-1 px-1.5 hover:bg-muted rounded text-xs flex flex-col items-center justify-center opacity-60 hover:opacity-100 transition-opacity whitespace-nowrap text-muted-foreground hover:text-foreground" onClick={() => editor()?.chain().focus().deleteRow().run()} title="Delete Row"><Trash2 size={14} /> -Row</button>
<div class="w-px bg-border my-1 mx-0.5 shrink-0" />
<button type="button" class="p-1 px-1.5 hover:bg-muted rounded text-xs flex flex-col items-center justify-center opacity-80 hover:opacity-100 transition-opacity whitespace-nowrap text-muted-foreground hover:text-foreground" onClick={() => editor()?.chain().focus().addColumnBefore().run()} title="Add Col Left"><ArrowLeftToLine size={14} /> +Col</button>
<button type="button" class="p-1 px-1.5 hover:bg-muted rounded text-xs flex flex-col items-center justify-center opacity-80 hover:opacity-100 transition-opacity whitespace-nowrap text-muted-foreground hover:text-foreground" onClick={() => editor()?.chain().focus().addColumnAfter().run()} title="Add Col Right"><ArrowRightToLine size={14} /> +Col</button>
<button type="button" class="p-1 px-1.5 hover:bg-muted rounded text-xs flex flex-col items-center justify-center opacity-60 hover:opacity-100 transition-opacity whitespace-nowrap text-muted-foreground hover:text-foreground" onClick={() => editor()?.chain().focus().deleteColumn().run()} title="Delete Col"><Trash2 size={14} /> -Col</button>
</div>
{/* Note Preview Popover */}
<Show when={previewNote() && store.notes.find(n => n.id === previewNote()!.noteId)}>
{(note) => {