From bcdee2238f1436d43a3bcc918309888ee388b9a6 Mon Sep 17 00:00:00 2001 From: u8array Date: Thu, 7 May 2026 23:27:43 +0200 Subject: [PATCH 1/8] refactor(registry): use shared RotationSelect in text and serial text.tsx and serial.tsx were the last two registries duplicating the rotation-select markup inline (label + select with 4 hardcoded options). Every other rotation-using registry already routes through the shared RotationSelect component, which centralises the t.registry.text.rotation* locale-key reuse so the cross-block access lives in one well-named place instead of being spread across two more files. --- src/registry/serial.tsx | 18 +++++------------- src/registry/text.tsx | 18 +++++------------- 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/src/registry/serial.tsx b/src/registry/serial.tsx index 8673a724..fdd8fcae 100644 --- a/src/registry/serial.tsx +++ b/src/registry/serial.tsx @@ -3,6 +3,7 @@ import { useT } from '../lib/useT'; import { inputCls, labelCls } from '../components/Properties/styles'; import { fieldPos } from './zplHelpers'; import { filterContent, type ContentSpec } from './contentSpec'; +import { RotationSelect } from '../components/Properties/RotationSelect'; const serialSpec: ContentSpec = { charset: '0-9A-Za-z' }; @@ -89,19 +90,10 @@ export const serial: ObjectTypeDefinition = { -
- - -
+ onChange({ rotation })} + />
diff --git a/src/registry/text.tsx b/src/registry/text.tsx index 863b2ac5..a5af5c12 100644 --- a/src/registry/text.tsx +++ b/src/registry/text.tsx @@ -5,6 +5,7 @@ import { inputCls, labelCls } from '../components/Properties/styles'; import { fieldPos, fdField } from './zplHelpers'; import { getFont, getAllFonts, loadFontFile } from '../lib/fontCache'; import { useFontCacheVersion } from '../hooks/useFontCacheVersion'; +import { RotationSelect } from '../components/Properties/RotationSelect'; export interface TextProps { content: string; @@ -154,19 +155,10 @@ export const text: ObjectTypeDefinition = {
-
- - -
+ onChange({ rotation })} + />