@mandujs/core 0.18.22 β 0.19.2
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.
- package/README.ko.md +0 -14
- package/package.json +4 -1
- package/src/brain/architecture/analyzer.ts +4 -4
- package/src/brain/doctor/analyzer.ts +18 -14
- package/src/bundler/build.test.ts +127 -0
- package/src/bundler/build.ts +291 -113
- package/src/bundler/css.ts +20 -5
- package/src/bundler/dev.ts +55 -2
- package/src/bundler/prerender.ts +195 -0
- package/src/change/snapshot.ts +4 -23
- package/src/change/types.ts +2 -3
- package/src/client/Form.tsx +105 -0
- package/src/client/__tests__/use-sse.test.ts +153 -0
- package/src/client/hooks.ts +105 -6
- package/src/client/index.ts +35 -6
- package/src/client/router.ts +670 -433
- package/src/client/rpc.ts +140 -0
- package/src/client/runtime.ts +24 -21
- package/src/client/use-fetch.ts +239 -0
- package/src/client/use-head.ts +197 -0
- package/src/client/use-sse.ts +378 -0
- package/src/components/Image.tsx +162 -0
- package/src/config/mandu.ts +5 -0
- package/src/config/validate.ts +34 -0
- package/src/content/index.ts +5 -1
- package/src/devtools/client/catchers/error-catcher.ts +17 -0
- package/src/devtools/client/catchers/network-proxy.ts +390 -367
- package/src/devtools/client/components/kitchen-root.tsx +479 -467
- package/src/devtools/client/components/panel/diff-viewer.tsx +219 -0
- package/src/devtools/client/components/panel/guard-panel.tsx +374 -244
- package/src/devtools/client/components/panel/index.ts +45 -32
- package/src/devtools/client/components/panel/panel-container.tsx +332 -312
- package/src/devtools/client/components/panel/preview-panel.tsx +188 -0
- package/src/devtools/client/state-manager.ts +535 -478
- package/src/devtools/design-tokens.ts +265 -264
- package/src/devtools/types.ts +345 -319
- package/src/filling/context.ts +65 -0
- package/src/filling/filling.ts +336 -14
- package/src/filling/index.ts +5 -1
- package/src/filling/session.ts +216 -0
- package/src/filling/ws.ts +78 -0
- package/src/generator/generate.ts +2 -2
- package/src/guard/auto-correct.ts +0 -29
- package/src/guard/check.ts +14 -31
- package/src/guard/presets/index.ts +296 -294
- package/src/guard/rules.ts +15 -19
- package/src/guard/validator.ts +834 -834
- package/src/index.ts +5 -1
- package/src/island/index.ts +373 -304
- package/src/kitchen/api/contract-api.ts +225 -0
- package/src/kitchen/api/diff-parser.ts +108 -0
- package/src/kitchen/api/file-api.ts +273 -0
- package/src/kitchen/api/guard-api.ts +83 -0
- package/src/kitchen/api/guard-decisions.ts +100 -0
- package/src/kitchen/api/routes-api.ts +50 -0
- package/src/kitchen/index.ts +21 -0
- package/src/kitchen/kitchen-handler.ts +256 -0
- package/src/kitchen/kitchen-ui.ts +1732 -0
- package/src/kitchen/stream/activity-sse.ts +145 -0
- package/src/kitchen/stream/file-tailer.ts +99 -0
- package/src/middleware/compress.ts +62 -0
- package/src/middleware/cors.ts +47 -0
- package/src/middleware/index.ts +10 -0
- package/src/middleware/jwt.ts +134 -0
- package/src/middleware/logger.ts +58 -0
- package/src/middleware/timeout.ts +55 -0
- package/src/paths.ts +0 -4
- package/src/plugins/hooks.ts +64 -0
- package/src/plugins/index.ts +3 -0
- package/src/plugins/types.ts +5 -0
- package/src/report/build.ts +0 -6
- package/src/resource/__tests__/backward-compat.test.ts +0 -1
- package/src/router/fs-patterns.ts +11 -1
- package/src/router/fs-routes.ts +78 -14
- package/src/router/fs-scanner.ts +2 -2
- package/src/router/fs-types.ts +2 -1
- package/src/runtime/adapter-bun.ts +62 -0
- package/src/runtime/adapter.ts +47 -0
- package/src/runtime/cache.ts +310 -0
- package/src/runtime/handler.ts +65 -0
- package/src/runtime/image-handler.ts +195 -0
- package/src/runtime/index.ts +12 -0
- package/src/runtime/middleware.ts +263 -0
- package/src/runtime/server.ts +686 -92
- package/src/runtime/ssr.ts +55 -29
- package/src/runtime/streaming-ssr.ts +106 -82
- package/src/spec/index.ts +0 -1
- package/src/spec/schema.ts +1 -0
- package/src/testing/index.ts +144 -0
- package/src/watcher/watcher.ts +27 -1
- package/src/spec/lock.ts +0 -56
|
@@ -1,312 +1,332 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mandu Kitchen DevTools - Panel Container
|
|
3
|
-
* @version 1.0.3
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import React, { useState, useCallback } from 'react';
|
|
7
|
-
import { colors, typography, spacing, borderRadius, shadows, zIndex, animation, testIds } from '../../../design-tokens';
|
|
8
|
-
import type { KitchenState } from '../../state-manager';
|
|
9
|
-
|
|
10
|
-
// ============================================================================
|
|
11
|
-
// Types
|
|
12
|
-
// ============================================================================
|
|
13
|
-
|
|
14
|
-
export type TabId = 'errors' | 'islands' | 'network' | 'guard';
|
|
15
|
-
|
|
16
|
-
export interface TabDefinition {
|
|
17
|
-
id: TabId;
|
|
18
|
-
label: string;
|
|
19
|
-
icon: string;
|
|
20
|
-
testId: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface PanelContainerProps {
|
|
24
|
-
state: KitchenState;
|
|
25
|
-
activeTab: TabId;
|
|
26
|
-
onTabChange: (tab: TabId) => void;
|
|
27
|
-
onClose: () => void;
|
|
28
|
-
onRestart?: () => void;
|
|
29
|
-
position: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
30
|
-
children: React.ReactNode;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// ============================================================================
|
|
34
|
-
// Constants
|
|
35
|
-
// ============================================================================
|
|
36
|
-
|
|
37
|
-
export const TABS: TabDefinition[] = [
|
|
38
|
-
{ id: 'errors', label: 'μλ¬', icon: 'π₯', testId: testIds.tabErrors },
|
|
39
|
-
{ id: 'islands', label: 'Islands', icon: 'ποΈ', testId: testIds.tabIslands },
|
|
40
|
-
{ id: 'network', label: 'Network', icon: 'π‘', testId: testIds.tabNetwork },
|
|
41
|
-
{ id: 'guard', label: 'Guard', icon: 'π‘οΈ', testId: testIds.tabGuard },
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
'bottom-
|
|
168
|
-
'
|
|
169
|
-
'top-
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
//
|
|
174
|
-
//
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
const [
|
|
187
|
-
const [
|
|
188
|
-
const [
|
|
189
|
-
const [
|
|
190
|
-
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
case '
|
|
196
|
-
return
|
|
197
|
-
case '
|
|
198
|
-
return state.
|
|
199
|
-
|
|
200
|
-
return
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
{
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
<div style={styles.
|
|
230
|
-
{
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Mandu Kitchen DevTools - Panel Container
|
|
3
|
+
* @version 1.0.3
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React, { useState, useCallback } from 'react';
|
|
7
|
+
import { colors, typography, spacing, borderRadius, shadows, zIndex, animation, testIds } from '../../../design-tokens';
|
|
8
|
+
import type { KitchenState } from '../../state-manager';
|
|
9
|
+
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// Types
|
|
12
|
+
// ============================================================================
|
|
13
|
+
|
|
14
|
+
export type TabId = 'errors' | 'islands' | 'network' | 'guard' | 'preview';
|
|
15
|
+
|
|
16
|
+
export interface TabDefinition {
|
|
17
|
+
id: TabId;
|
|
18
|
+
label: string;
|
|
19
|
+
icon: string;
|
|
20
|
+
testId: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface PanelContainerProps {
|
|
24
|
+
state: KitchenState;
|
|
25
|
+
activeTab: TabId;
|
|
26
|
+
onTabChange: (tab: TabId) => void;
|
|
27
|
+
onClose: () => void;
|
|
28
|
+
onRestart?: () => void;
|
|
29
|
+
position: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
30
|
+
children: React.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// ============================================================================
|
|
34
|
+
// Constants
|
|
35
|
+
// ============================================================================
|
|
36
|
+
|
|
37
|
+
export const TABS: TabDefinition[] = [
|
|
38
|
+
{ id: 'errors', label: 'μλ¬', icon: 'π₯', testId: testIds.tabErrors },
|
|
39
|
+
{ id: 'islands', label: 'Islands', icon: 'ποΈ', testId: testIds.tabIslands },
|
|
40
|
+
{ id: 'network', label: 'Network', icon: 'π‘', testId: testIds.tabNetwork },
|
|
41
|
+
{ id: 'guard', label: 'Guard', icon: 'π‘οΈ', testId: testIds.tabGuard },
|
|
42
|
+
{ id: 'preview', label: 'Preview', icon: 'π', testId: testIds.tabPreview },
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
// ============================================================================
|
|
46
|
+
// Styles
|
|
47
|
+
// ============================================================================
|
|
48
|
+
|
|
49
|
+
const styles = {
|
|
50
|
+
container: {
|
|
51
|
+
position: 'fixed' as const,
|
|
52
|
+
width: '420px',
|
|
53
|
+
maxHeight: '70vh',
|
|
54
|
+
backgroundColor: colors.background.dark,
|
|
55
|
+
borderRadius: borderRadius.lg,
|
|
56
|
+
boxShadow: shadows.xl,
|
|
57
|
+
display: 'flex',
|
|
58
|
+
flexDirection: 'column' as const,
|
|
59
|
+
overflow: 'hidden',
|
|
60
|
+
zIndex: zIndex.devtools,
|
|
61
|
+
fontFamily: typography.fontFamily.sans,
|
|
62
|
+
transition: `all ${animation.duration.normal} ${animation.easing.easeOut}`,
|
|
63
|
+
},
|
|
64
|
+
header: {
|
|
65
|
+
display: 'flex',
|
|
66
|
+
alignItems: 'center',
|
|
67
|
+
justifyContent: 'space-between',
|
|
68
|
+
padding: `${spacing.sm} ${spacing.md}`,
|
|
69
|
+
borderBottom: `1px solid ${colors.background.light}`,
|
|
70
|
+
backgroundColor: colors.background.medium,
|
|
71
|
+
},
|
|
72
|
+
title: {
|
|
73
|
+
display: 'flex',
|
|
74
|
+
alignItems: 'center',
|
|
75
|
+
gap: spacing.sm,
|
|
76
|
+
fontSize: typography.fontSize.sm,
|
|
77
|
+
fontWeight: typography.fontWeight.semibold,
|
|
78
|
+
color: colors.text.primary,
|
|
79
|
+
},
|
|
80
|
+
logo: {
|
|
81
|
+
fontSize: typography.fontSize.lg,
|
|
82
|
+
},
|
|
83
|
+
headerActions: {
|
|
84
|
+
display: 'flex',
|
|
85
|
+
alignItems: 'center',
|
|
86
|
+
gap: spacing.xs,
|
|
87
|
+
},
|
|
88
|
+
restartButton: {
|
|
89
|
+
background: 'transparent',
|
|
90
|
+
border: 'none',
|
|
91
|
+
color: colors.text.secondary,
|
|
92
|
+
fontSize: typography.fontSize.md,
|
|
93
|
+
cursor: 'pointer',
|
|
94
|
+
padding: spacing.xs,
|
|
95
|
+
borderRadius: borderRadius.sm,
|
|
96
|
+
lineHeight: 1,
|
|
97
|
+
transition: `all ${animation.duration.fast}`,
|
|
98
|
+
},
|
|
99
|
+
closeButton: {
|
|
100
|
+
background: 'transparent',
|
|
101
|
+
border: 'none',
|
|
102
|
+
color: colors.text.secondary,
|
|
103
|
+
fontSize: typography.fontSize.lg,
|
|
104
|
+
cursor: 'pointer',
|
|
105
|
+
padding: spacing.xs,
|
|
106
|
+
borderRadius: borderRadius.sm,
|
|
107
|
+
lineHeight: 1,
|
|
108
|
+
transition: `color ${animation.duration.fast}`,
|
|
109
|
+
},
|
|
110
|
+
tabs: {
|
|
111
|
+
display: 'flex',
|
|
112
|
+
borderBottom: `1px solid ${colors.background.light}`,
|
|
113
|
+
backgroundColor: colors.background.dark,
|
|
114
|
+
},
|
|
115
|
+
tab: {
|
|
116
|
+
flex: 1,
|
|
117
|
+
display: 'flex',
|
|
118
|
+
alignItems: 'center',
|
|
119
|
+
justifyContent: 'center',
|
|
120
|
+
gap: spacing.xs,
|
|
121
|
+
padding: `${spacing.sm} ${spacing.md}`,
|
|
122
|
+
background: 'transparent',
|
|
123
|
+
border: 'none',
|
|
124
|
+
borderBottom: '2px solid transparent',
|
|
125
|
+
color: colors.text.secondary,
|
|
126
|
+
fontSize: typography.fontSize.sm,
|
|
127
|
+
cursor: 'pointer',
|
|
128
|
+
transition: `all ${animation.duration.fast}`,
|
|
129
|
+
},
|
|
130
|
+
tabActive: {
|
|
131
|
+
color: colors.brand.accent,
|
|
132
|
+
borderBottomColor: colors.brand.accent,
|
|
133
|
+
backgroundColor: 'rgba(232, 150, 122, 0.12)',
|
|
134
|
+
},
|
|
135
|
+
tabIcon: {
|
|
136
|
+
fontSize: typography.fontSize.md,
|
|
137
|
+
},
|
|
138
|
+
tabBadge: {
|
|
139
|
+
minWidth: '18px',
|
|
140
|
+
height: '18px',
|
|
141
|
+
padding: '0 4px',
|
|
142
|
+
borderRadius: borderRadius.full,
|
|
143
|
+
backgroundColor: colors.semantic.error,
|
|
144
|
+
color: colors.text.primary,
|
|
145
|
+
fontSize: typography.fontSize.xs,
|
|
146
|
+
fontWeight: typography.fontWeight.semibold,
|
|
147
|
+
display: 'flex',
|
|
148
|
+
alignItems: 'center',
|
|
149
|
+
justifyContent: 'center',
|
|
150
|
+
},
|
|
151
|
+
content: {
|
|
152
|
+
flex: 1,
|
|
153
|
+
overflow: 'auto',
|
|
154
|
+
minHeight: '200px',
|
|
155
|
+
maxHeight: '50vh',
|
|
156
|
+
},
|
|
157
|
+
resizeHandle: {
|
|
158
|
+
position: 'absolute' as const,
|
|
159
|
+
width: '100%',
|
|
160
|
+
height: '4px',
|
|
161
|
+
cursor: 'ns-resize',
|
|
162
|
+
backgroundColor: 'transparent',
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const positionStyles: Record<string, React.CSSProperties> = {
|
|
167
|
+
'bottom-right': { bottom: '80px', right: '16px' },
|
|
168
|
+
'bottom-left': { bottom: '80px', left: '16px' },
|
|
169
|
+
'top-right': { top: '16px', right: '16px' },
|
|
170
|
+
'top-left': { top: '16px', left: '16px' },
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
// ============================================================================
|
|
174
|
+
// Component
|
|
175
|
+
// ============================================================================
|
|
176
|
+
|
|
177
|
+
export function PanelContainer({
|
|
178
|
+
state,
|
|
179
|
+
activeTab,
|
|
180
|
+
onTabChange,
|
|
181
|
+
onClose,
|
|
182
|
+
onRestart,
|
|
183
|
+
position,
|
|
184
|
+
children,
|
|
185
|
+
}: PanelContainerProps): React.ReactElement {
|
|
186
|
+
const [isResizing, setIsResizing] = useState(false);
|
|
187
|
+
const [height, setHeight] = useState(400);
|
|
188
|
+
const [hoveredTab, setHoveredTab] = useState<TabId | null>(null);
|
|
189
|
+
const [isCloseHovered, setIsCloseHovered] = useState(false);
|
|
190
|
+
const [isRestartHovered, setIsRestartHovered] = useState(false);
|
|
191
|
+
const [isExpandHovered, setIsExpandHovered] = useState(false);
|
|
192
|
+
|
|
193
|
+
const getTabBadgeCount = useCallback((tabId: TabId): number => {
|
|
194
|
+
switch (tabId) {
|
|
195
|
+
case 'errors':
|
|
196
|
+
return state.errors.filter(e => e.severity === 'error' || e.severity === 'critical').length;
|
|
197
|
+
case 'islands':
|
|
198
|
+
return Array.from(state.islands.values()).filter(i => i.status === 'error').length;
|
|
199
|
+
case 'guard':
|
|
200
|
+
return state.guardViolations.length;
|
|
201
|
+
case 'preview':
|
|
202
|
+
return state.recentChanges?.length ?? 0;
|
|
203
|
+
default:
|
|
204
|
+
return 0;
|
|
205
|
+
}
|
|
206
|
+
}, [state]);
|
|
207
|
+
|
|
208
|
+
const containerStyle: React.CSSProperties = {
|
|
209
|
+
...styles.container,
|
|
210
|
+
...positionStyles[position],
|
|
211
|
+
height: `${height}px`,
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
return (
|
|
215
|
+
<div
|
|
216
|
+
data-testid={testIds.panel}
|
|
217
|
+
style={containerStyle}
|
|
218
|
+
>
|
|
219
|
+
{/* Resize Handle (top) */}
|
|
220
|
+
{position.startsWith('bottom') && (
|
|
221
|
+
<div
|
|
222
|
+
style={{ ...styles.resizeHandle, top: 0 }}
|
|
223
|
+
onMouseDown={() => setIsResizing(true)}
|
|
224
|
+
/>
|
|
225
|
+
)}
|
|
226
|
+
|
|
227
|
+
{/* Header */}
|
|
228
|
+
<div style={styles.header}>
|
|
229
|
+
<div style={styles.title}>
|
|
230
|
+
<span style={styles.logo}>π₯</span>
|
|
231
|
+
<span>Mandu Kitchen</span>
|
|
232
|
+
</div>
|
|
233
|
+
<div style={styles.headerActions}>
|
|
234
|
+
{onRestart && (
|
|
235
|
+
<button
|
|
236
|
+
data-testid={testIds.restartButton}
|
|
237
|
+
style={{
|
|
238
|
+
...styles.restartButton,
|
|
239
|
+
...(isRestartHovered ? {
|
|
240
|
+
color: colors.semantic.warning,
|
|
241
|
+
backgroundColor: `${colors.semantic.warning}18`,
|
|
242
|
+
} : {}),
|
|
243
|
+
}}
|
|
244
|
+
onClick={onRestart}
|
|
245
|
+
onMouseEnter={() => setIsRestartHovered(true)}
|
|
246
|
+
onMouseLeave={() => setIsRestartHovered(false)}
|
|
247
|
+
aria-label="μΊμ μ§μ°κ³ μμ μ¬μμ"
|
|
248
|
+
title="μΊμ μ§μ°κ³ μμ μ¬μμ"
|
|
249
|
+
>
|
|
250
|
+
π
|
|
251
|
+
</button>
|
|
252
|
+
)}
|
|
253
|
+
<button
|
|
254
|
+
style={{
|
|
255
|
+
...styles.restartButton,
|
|
256
|
+
...(isExpandHovered ? {
|
|
257
|
+
color: colors.brand.accent,
|
|
258
|
+
backgroundColor: `${colors.brand.accent}18`,
|
|
259
|
+
} : {}),
|
|
260
|
+
}}
|
|
261
|
+
onClick={() => window.open('/__kitchen', '_blank')}
|
|
262
|
+
onMouseEnter={() => setIsExpandHovered(true)}
|
|
263
|
+
onMouseLeave={() => setIsExpandHovered(false)}
|
|
264
|
+
aria-label="ν νμ΄μ§λ‘ μ΄κΈ°"
|
|
265
|
+
title="ν νμ΄μ§λ‘ μ΄κΈ°"
|
|
266
|
+
>
|
|
267
|
+
π²
|
|
268
|
+
</button>
|
|
269
|
+
<button
|
|
270
|
+
style={{
|
|
271
|
+
...styles.closeButton,
|
|
272
|
+
...(isCloseHovered ? { color: colors.text.primary, backgroundColor: 'rgba(255, 255, 255, 0.08)' } : {}),
|
|
273
|
+
}}
|
|
274
|
+
onClick={onClose}
|
|
275
|
+
onMouseEnter={() => setIsCloseHovered(true)}
|
|
276
|
+
onMouseLeave={() => setIsCloseHovered(false)}
|
|
277
|
+
aria-label="ν¨λ λ«κΈ°"
|
|
278
|
+
>
|
|
279
|
+
Γ
|
|
280
|
+
</button>
|
|
281
|
+
</div>
|
|
282
|
+
</div>
|
|
283
|
+
|
|
284
|
+
{/* Tabs */}
|
|
285
|
+
<div style={styles.tabs} role="tablist">
|
|
286
|
+
{TABS.map((tab) => {
|
|
287
|
+
const isActive = activeTab === tab.id;
|
|
288
|
+
const badgeCount = getTabBadgeCount(tab.id);
|
|
289
|
+
|
|
290
|
+
return (
|
|
291
|
+
<button
|
|
292
|
+
key={tab.id}
|
|
293
|
+
data-testid={tab.testId}
|
|
294
|
+
role="tab"
|
|
295
|
+
aria-selected={isActive}
|
|
296
|
+
style={{
|
|
297
|
+
...styles.tab,
|
|
298
|
+
...(isActive ? styles.tabActive : {}),
|
|
299
|
+
...(!isActive && hoveredTab === tab.id ? {
|
|
300
|
+
color: colors.text.primary,
|
|
301
|
+
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
|
302
|
+
} : {}),
|
|
303
|
+
}}
|
|
304
|
+
onClick={() => onTabChange(tab.id)}
|
|
305
|
+
onMouseEnter={() => setHoveredTab(tab.id)}
|
|
306
|
+
onMouseLeave={() => setHoveredTab(null)}
|
|
307
|
+
>
|
|
308
|
+
<span style={styles.tabIcon}>{tab.icon}</span>
|
|
309
|
+
<span>{tab.label}</span>
|
|
310
|
+
{badgeCount > 0 && (
|
|
311
|
+
<span style={styles.tabBadge}>{badgeCount > 99 ? '99+' : badgeCount}</span>
|
|
312
|
+
)}
|
|
313
|
+
</button>
|
|
314
|
+
);
|
|
315
|
+
})}
|
|
316
|
+
</div>
|
|
317
|
+
|
|
318
|
+
{/* Content */}
|
|
319
|
+
<div style={styles.content} role="tabpanel">
|
|
320
|
+
{children}
|
|
321
|
+
</div>
|
|
322
|
+
|
|
323
|
+
{/* Resize Handle (bottom) */}
|
|
324
|
+
{position.startsWith('top') && (
|
|
325
|
+
<div
|
|
326
|
+
style={{ ...styles.resizeHandle, bottom: 0 }}
|
|
327
|
+
onMouseDown={() => setIsResizing(true)}
|
|
328
|
+
/>
|
|
329
|
+
)}
|
|
330
|
+
</div>
|
|
331
|
+
);
|
|
332
|
+
}
|