From 9f1097104161debf1b795cbc80fd88025636e0ef Mon Sep 17 00:00:00 2001 From: isUnknown Date: Wed, 3 Dec 2025 15:20:49 +0100 Subject: [PATCH] feat: implement reactive EditorPanel with bidirectional sync MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Reorganize editor components into dedicated folder - Create PageSettings component with page format, margins, background controls - Create TextSettings component (structure only, to be populated) - Implement debounced updates (1s delay) to stylesheet store - Add bidirectional sync between EditorPanel and StylesheetViewer - Preserve scroll position as percentage when reloading preview - Move @page rules from App.vue to stylesheet.css for unified management - Extend css-parsing utils to handle text values (e.g., 'A4', 'portrait') - Remove unnecessary comments, use explicit naming instead 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- public/assets/css/stylesheet.css | 17 + src/App.vue | 78 ++-- src/components/EditorPanel.vue | 69 --- src/components/editor/EditorPanel.vue | 84 ++++ src/components/editor/PageSettings.vue | 360 +++++++++++++++ src/components/editor/TextSettings.vue | 604 +++++++++++++++++++++++++ src/utils/css-parsing.js | 58 +-- 7 files changed, 1104 insertions(+), 166 deletions(-) delete mode 100644 src/components/EditorPanel.vue create mode 100644 src/components/editor/EditorPanel.vue create mode 100644 src/components/editor/PageSettings.vue create mode 100644 src/components/editor/TextSettings.vue diff --git a/public/assets/css/stylesheet.css b/public/assets/css/stylesheet.css index ea6e1c4..f7710ce 100644 --- a/public/assets/css/stylesheet.css +++ b/public/assets/css/stylesheet.css @@ -1,3 +1,20 @@ +@page { + size: A4; + margin: 20mm 15mm 26mm 15mm; +} + +@page { + @bottom-center { content: string(title); } +} + +h2 { + break-before: page; +} + +.chapter > h2 { + string-set: title content(text); +} + #chapter-2 { font-size: 2rem; } diff --git a/src/App.vue b/src/App.vue index 99dca4e..b5d616a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,59 +1,33 @@