feat(editor): F4.4b the design tools: palette, moving, cables, menus, undo
The palette in Java's order with Java's icons and names: a device dragged onto the surface lands with its icon at the drop point, a tapped one in the middle of the view; a new router asks for 2 to 8 interfaces as Java does. A tap selects, a drag moves (divided by the scale), a long press or the three-dot button opens Java's menu. The cable tool plugs by a drag or by two taps, shows WAN or LAN on a home router's halves and Java's messages when refused. Delete removes the selection; undo and redo by button and Ctrl+Z/Ctrl+Y, each editor with its own origin. Browser tests with mouse and touch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -28,6 +28,22 @@ const FROM_JAVA: Readonly<Record<string, string>> = {
|
||||
'device.router': 'hw_vermittlungsrechner_msg1',
|
||||
'device.gateway': 'hw_gateway_msg1',
|
||||
'device.cable': 'hw_kabel_msg1',
|
||||
'menu.removeCable': 'guievents_msg5',
|
||||
'menu.removeAllCables': 'guievents_msg6',
|
||||
'menu.delete': 'guievents_msg7',
|
||||
'cable.noFreePort': 'guievents_msg1',
|
||||
'cable.alreadyConnected': 'guievents_msg12',
|
||||
'cable.wanOccupied': 'guievents_msg22',
|
||||
'cable.lanOccupied': 'guievents_msg23',
|
||||
'cable.wan': 'guievents_msg24',
|
||||
'cable.lan': 'guievents_msg25',
|
||||
'cable.wirelessNotPossible': 'guievents_msg26',
|
||||
'router.title': 'guicontainer_msg2',
|
||||
};
|
||||
|
||||
/** Java's words with an error of Java's mended: the prompt says "Vermittlungsrechnerns" (guicontainer_msg1). */
|
||||
const FROM_JAVA_MENDED: Readonly<Record<string, readonly [string, (java: string) => string]>> = {
|
||||
'router.prompt': ['guicontainer_msg1', (java) => java.replace(' \\n ', ' ').replace('Vermittlungsrechnerns', 'Vermittlungsrechners')],
|
||||
};
|
||||
|
||||
describe('the catalogs', () => {
|
||||
@@ -54,5 +70,9 @@ describe('the catalogs', () => {
|
||||
expect(CATALOGS.de[key], key).toBe(de.get(javaKey));
|
||||
expect(CATALOGS.en[key], key).toBe(en.get(javaKey));
|
||||
}
|
||||
for (const [key, [javaKey, mend]] of Object.entries(FROM_JAVA_MENDED)) {
|
||||
expect(CATALOGS.de[key], key).toBe(mend(de.get(javaKey)!));
|
||||
expect(CATALOGS.en[key], key).toBe(mend(en.get(javaKey)!));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user