From 371892fb5ac132e5d16eb73286d3bb282180e79a Mon Sep 17 00:00:00 2001 From: Tsuzat Date: Thu, 6 Feb 2025 14:20:08 +0530 Subject: [PATCH] feat: improve table component with dynamic grid selection and active state --- .../components/shad-editor/icons/table.svelte | 202 ++++++++++-------- 1 file changed, 111 insertions(+), 91 deletions(-) diff --git a/src/lib/components/shad-editor/icons/table.svelte b/src/lib/components/shad-editor/icons/table.svelte index 9c3222a..9d5eb14 100644 --- a/src/lib/components/shad-editor/icons/table.svelte +++ b/src/lib/components/shad-editor/icons/table.svelte @@ -2,110 +2,130 @@ import { Button } from '$lib/components/ui/button/index.js'; import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js'; import * as Tooltip from '$lib/components/ui/tooltip/index.js'; + import { cn } from '$lib/utils.js'; import { type Editor } from '@tiptap/core'; import { Table, ChevronDown } from 'lucide-svelte'; - let { editor }: { editor: Editor } = $props(); + const isTableActive = $derived.by(() => editor.isActive('table')); + let rows = $state(3); + let cols = $state(3); + const blocks = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + let open = $state(false); - - - - - -