create-asciitorium 0.1.33 → 0.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,8 +4,10 @@ import {
|
|
|
4
4
|
Select,
|
|
5
5
|
Switch,
|
|
6
6
|
Row,
|
|
7
|
-
PersistentState,
|
|
8
7
|
Text,
|
|
8
|
+
PerfMonitor,
|
|
9
|
+
State,
|
|
10
|
+
Keybind,
|
|
9
11
|
} from 'asciitorium';
|
|
10
12
|
|
|
11
13
|
import {
|
|
@@ -23,7 +25,10 @@ import {
|
|
|
23
25
|
} from 'asciitorium/examples';
|
|
24
26
|
|
|
25
27
|
// Main state for component selection with persistence
|
|
26
|
-
const selectedComponent = new
|
|
28
|
+
const selectedComponent = new State('Art');
|
|
29
|
+
|
|
30
|
+
// State for PerfMonitor visibility (P toggle)
|
|
31
|
+
const showPerfMonitor = new State(false);
|
|
27
32
|
|
|
28
33
|
// Component list for navigation
|
|
29
34
|
const componentList = [
|
|
@@ -55,8 +60,15 @@ const examples = {
|
|
|
55
60
|
Tabs: TabsExample,
|
|
56
61
|
};
|
|
57
62
|
|
|
63
|
+
// toggle PerfMonitor with "P" key
|
|
64
|
+
const togglePerfMonitor = () => {
|
|
65
|
+
showPerfMonitor.value = !showPerfMonitor.value;
|
|
66
|
+
};
|
|
67
|
+
|
|
58
68
|
const app = (
|
|
59
|
-
<App
|
|
69
|
+
<App>
|
|
70
|
+
<Keybind keyBinding="p" action={togglePerfMonitor} global />
|
|
71
|
+
|
|
60
72
|
<Art
|
|
61
73
|
src={'./art/asciitorium.txt'}
|
|
62
74
|
style={{ align: 'center', gap: { bottom: 2 } }}
|
|
@@ -81,9 +93,10 @@ const app = (
|
|
|
81
93
|
/>
|
|
82
94
|
</Row>
|
|
83
95
|
<Text
|
|
84
|
-
content="Navigation: ↑↓
|
|
85
|
-
style={{ align: 'center', gap:
|
|
96
|
+
content="Navigation: ↑↓ • [Space]/[Enter] to select • [Tab]/[Tab+Shift] to switch focus • [P] toggles performance monitor"
|
|
97
|
+
style={{ align: 'center', gap: 1 }}
|
|
86
98
|
/>
|
|
99
|
+
<PerfMonitor visible={showPerfMonitor} />
|
|
87
100
|
</App>
|
|
88
101
|
);
|
|
89
102
|
|