From 919469c9fb6690f7df590a955ffdc25f2df2e287 Mon Sep 17 00:00:00 2001 From: DeVaNsHk72 <56186839+Devanshk9@users.noreply.github.com> Date: Wed, 21 Jan 2026 23:09:29 +0530 Subject: [PATCH 1/6] feat: improved table --- src/components/TextEditor/commands.js | 8 +- src/components/TextEditor/components/Menu.vue | 28 +- .../components/TableSizeSelector.vue | 70 ++ .../components/TextEditorBubbleMenu.vue | 40 +- .../extensions/tables/TableBorderMenu.vue | 288 +++++++ .../tables/TableBorderMenuContainer.vue | 275 ++++++ .../tables/custom-column-resizing.ts | 173 ++++ .../tables/table-border-menu-plugin.ts | 790 ++++++++++++++++++ .../extensions/tables/table-cell-extension.ts | 76 ++ .../extensions/tables/table-extension.ts | 79 ++ .../tables/table-header-extension.ts | 73 ++ .../tables/table-individual-cell-plugin.ts | 266 ++++++ .../extensions/tables/table-row-extension.ts | 69 ++ .../tables/table-selection-extension.ts | 148 ++++ .../extensions/tables/table-styles.css | 232 +++++ .../extensions/tables/use-table-menu.ts | 118 +++ 16 files changed, 2697 insertions(+), 36 deletions(-) create mode 100644 src/components/TextEditor/components/TableSizeSelector.vue create mode 100644 src/components/TextEditor/extensions/tables/TableBorderMenu.vue create mode 100644 src/components/TextEditor/extensions/tables/TableBorderMenuContainer.vue create mode 100644 src/components/TextEditor/extensions/tables/custom-column-resizing.ts create mode 100644 src/components/TextEditor/extensions/tables/table-border-menu-plugin.ts create mode 100644 src/components/TextEditor/extensions/tables/table-cell-extension.ts create mode 100644 src/components/TextEditor/extensions/tables/table-extension.ts create mode 100644 src/components/TextEditor/extensions/tables/table-header-extension.ts create mode 100644 src/components/TextEditor/extensions/tables/table-individual-cell-plugin.ts create mode 100644 src/components/TextEditor/extensions/tables/table-row-extension.ts create mode 100644 src/components/TextEditor/extensions/tables/table-selection-extension.ts create mode 100644 src/components/TextEditor/extensions/tables/table-styles.css create mode 100644 src/components/TextEditor/extensions/tables/use-table-menu.ts diff --git a/src/components/TextEditor/commands.js b/src/components/TextEditor/commands.js index c359f6a2c..8c883fec6 100644 --- a/src/components/TextEditor/commands.js +++ b/src/components/TextEditor/commands.js @@ -216,12 +216,8 @@ export default { InsertTable: { label: 'Insert Table', icon: Table, - action: (editor) => - editor - .chain() - .focus() - .insertTable({ rows: 3, cols: 3, withHeaderRow: true }) - .run(), + component: defineAsyncComponent(() => import('./TableSizeSelector.vue')), + isTableSizeSelector: true, isActive: (editor) => editor.can().deleteTable(), }, AddColumnBefore: { diff --git a/src/components/TextEditor/components/Menu.vue b/src/components/TextEditor/components/Menu.vue index 0814552d8..39118f64c 100644 --- a/src/components/TextEditor/components/Menu.vue +++ b/src/components/TextEditor/components/Menu.vue @@ -35,15 +35,19 @@