From 55fb5a9c5429bda3ddce04ed6413c41b80f17f61 Mon Sep 17 00:00:00 2001 From: Md Afiq Iskandar Date: Tue, 15 Apr 2025 12:11:29 +0800 Subject: [PATCH] Enhance Form Builder with History Management and Component Updates - Implemented a history management system to track actions such as adding, updating, moving, and deleting components. - Added a new `FormBuilderHistory` component to display action history with undo/redo functionality. - Updated the `FormBuilderCanvas` and `FormBuilderComponents` to support history tracking and improved component selection. - Enhanced the form store to manage action history, including limits on history length and state restoration. - Improved user experience by integrating keyboard shortcuts for undo and redo actions. - Refactored various components to ensure proper state management and history recording during component modifications. --- components/ComponentPreview.vue | 105 +++++++- components/FormBuilderCanvas.vue | 5 + components/FormBuilderComponents.vue | 21 +- components/FormBuilderConfiguration.vue | 298 ++++++++++++++++------ components/FormBuilderHistory.vue | 250 +++++++++++++++++++ pages/form-builder/index.vue | 107 +++++++- stores/formBuilder.js | 312 +++++++++++++++++++++--- 7 files changed, 977 insertions(+), 121 deletions(-) create mode 100644 components/FormBuilderHistory.vue diff --git a/components/ComponentPreview.vue b/components/ComponentPreview.vue index 6eb46f1..e187f96 100644 --- a/components/ComponentPreview.vue +++ b/components/ComponentPreview.vue @@ -1,17 +1,17 @@