refactor: extract reusable UI components and composables from TextSettings

Major refactoring to improve code quality and reduce duplication:

TextSettings.vue: 1127 → 269 lines (-76%)

New composables:
- useCssUpdater.js: generic CSS update/remove functions
- useCssSync.js: CSS parsing to form fields

New UI components:
- UnitToggle.vue: reusable unit selector buttons
- InputWithUnit.vue: number input with unit toggle
- MarginEditor.vue: simple/detailed margin editor with sync

Benefits:
- Reusable components for other settings panels
- Centralized CSS manipulation logic
- Better separation of concerns
- Easier to test and maintain

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
isUnknown 2025-12-05 16:30:44 +01:00
parent 94112ab1a8
commit c4d2015a69
6 changed files with 647 additions and 1006 deletions

View file

@ -0,0 +1,28 @@
<template>
<div class="unit-toggle">
<button
v-for="unit in units"
:key="unit"
type="button"
:class="{ active: modelValue === unit }"
@click="$emit('update:modelValue', unit)"
>
{{ unit }}
</button>
</div>
</template>
<script setup>
defineProps({
modelValue: {
type: String,
required: true
},
units: {
type: Array,
default: () => ['mm', 'px']
}
});
defineEmits(['update:modelValue']);
</script>