Skip to content

Commit 48f5542

Browse files
authored
Merge pull request #9 from kongying-tavern/refactor/keyboard
refactor keyboard UI layout
2 parents f9c13ca + 9c14b3d commit 48f5542

File tree

9 files changed

+355
-241
lines changed

9 files changed

+355
-241
lines changed

src/shared/keyboardLayout.ts

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,27 @@
1-
export interface KeyboardLayoutOptions {
2-
framework: KeyboardFrameworkOptions;
3-
layout: KeyboardWidgetOption[];
1+
export interface KeyboardOption {
2+
layout: KeyboardComponentOption[];
43
}
54

6-
export interface KeyboardFrameworkOptions {
7-
// TODO
8-
}
5+
export type KeyboardLayoutOption = KeyboardRowOption;
6+
export type KeyboardWidgetOption = KeyboardKeyOption | KeyboardSpanOption;
7+
8+
export type KeyboardComponentOption =
9+
| KeyboardLayoutOption
10+
| KeyboardWidgetOption;
911

10-
export type KeyboardKeyType = "key" | "span" | "nl";
12+
export interface KeyboardRowOption {
13+
type: "row";
14+
children: KeyboardWidgetOption[];
15+
}
1116

1217
export interface KeyboardKeyOption {
18+
type: "key";
1319
width?: string | number;
14-
keyTextMain: string;
1520
keyCode: number;
21+
keyTextMain: string;
1622
}
1723

1824
export interface KeyboardSpanOption {
25+
type: "span";
1926
width: string | number;
2027
}
21-
22-
export interface KeyboardNlOption {}
23-
24-
export type KeyboardWidgetOptions =
25-
| KeyboardKeyOption
26-
| KeyboardSpanOption
27-
| KeyboardNlOption;
28-
29-
export interface KeyboardWidgetOption {
30-
type: KeyboardKeyType;
31-
options?: KeyboardWidgetOptions;
32-
}

src/views/pageTypewriter/PageTypewriter.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ import InputArea from "./components/InputArea.vue";
55
</script>
66

77
<template>
8-
<main class="flex flex-row fixed top-0 bottom-0 left-0 right-0">
9-
<div class="flex flex-col flex-3 p-3 space-y-3">
10-
<TextPreview class="flex-auto"></TextPreview>
11-
<InputArea class="flex-none"></InputArea>
12-
<ConfigBar class="flex-none"></ConfigBar>
13-
</div>
8+
<main class="flex flex-col fixed top-0 bottom-0 left-0 right-0 p-3 space-y-3">
9+
<TextPreview class="flex-auto"></TextPreview>
10+
<InputArea class="flex-none"></InputArea>
11+
<ConfigBar class="flex-none"></ConfigBar>
1412
</main>
1513
</template>
1614

0 commit comments

Comments
 (0)