@almadar/mobile 1.2.6 → 1.4.0
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/dist/chunk-4GLV4XIP.js +140 -0
- package/dist/chunk-4GLV4XIP.js.map +1 -0
- package/dist/{chunk-QUFLYKWA.js → chunk-A6AK75GP.js} +43 -554
- package/dist/chunk-A6AK75GP.js.map +1 -0
- package/dist/chunk-BUN5QD6C.js +525 -0
- package/dist/chunk-BUN5QD6C.js.map +1 -0
- package/dist/{chunk-PBO6ZN2M.js → chunk-C3USTXJ7.js} +1372 -2255
- package/dist/chunk-C3USTXJ7.js.map +1 -0
- package/dist/{chunk-5U5Z65ZO.js → chunk-DNC6CO6E.js} +58 -187
- package/dist/chunk-DNC6CO6E.js.map +1 -0
- package/dist/chunk-I6UYSB5R.js +935 -0
- package/dist/chunk-I6UYSB5R.js.map +1 -0
- package/dist/{chunk-ETD72PHO.js → chunk-SLYJ52HW.js} +30 -21
- package/dist/chunk-SLYJ52HW.js.map +1 -0
- package/dist/chunk-UIU7NWN2.js +924 -0
- package/dist/chunk-UIU7NWN2.js.map +1 -0
- package/dist/{chunk-BFRVXKSP.js → chunk-VNRKHWR7.js} +87 -4
- package/dist/chunk-VNRKHWR7.js.map +1 -0
- package/dist/{chunk-CA6Z3OTE.js → chunk-WHAG42QJ.js} +1 -1
- package/dist/chunk-WHAG42QJ.js.map +1 -0
- package/dist/{chunk-GMR5FKKB.js → chunk-XWPR5FXS.js} +2 -2
- package/dist/chunk-XWPR5FXS.js.map +1 -0
- package/dist/{chunk-MLTSQPVN.js → chunk-YWQRLHTP.js} +2 -2
- package/dist/chunk-YWQRLHTP.js.map +1 -0
- package/dist/components/atoms/Button.d.ts +3 -2
- package/dist/components/atoms/Button.d.ts.map +1 -1
- package/dist/components/atoms/Card.d.ts +3 -2
- package/dist/components/atoms/Card.d.ts.map +1 -1
- package/dist/components/atoms/Checkbox.d.ts +3 -2
- package/dist/components/atoms/Checkbox.d.ts.map +1 -1
- package/dist/components/atoms/DayCell.d.ts +3 -2
- package/dist/components/atoms/DayCell.d.ts.map +1 -1
- package/dist/components/atoms/InfiniteScrollSentinel.d.ts +3 -2
- package/dist/components/atoms/InfiniteScrollSentinel.d.ts.map +1 -1
- package/dist/components/atoms/Radio.d.ts +3 -2
- package/dist/components/atoms/Radio.d.ts.map +1 -1
- package/dist/components/atoms/RangeSlider.d.ts +3 -2
- package/dist/components/atoms/RangeSlider.d.ts.map +1 -1
- package/dist/components/atoms/Select.d.ts +3 -2
- package/dist/components/atoms/Select.d.ts.map +1 -1
- package/dist/components/atoms/Switch.d.ts +3 -2
- package/dist/components/atoms/Switch.d.ts.map +1 -1
- package/dist/components/atoms/TextHighlight.d.ts +3 -2
- package/dist/components/atoms/TextHighlight.d.ts.map +1 -1
- package/dist/components/atoms/game/OrbitalGameCanvas.d.ts +25 -0
- package/dist/components/atoms/game/OrbitalGameCanvas.d.ts.map +1 -0
- package/dist/components/atoms/game/index.d.ts +2 -0
- package/dist/components/atoms/game/index.d.ts.map +1 -1
- package/dist/components/atoms/index.d.ts +4 -4
- package/dist/components/atoms/index.d.ts.map +1 -1
- package/dist/components/atoms/index.js +14 -9
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +47 -20
- package/dist/components/molecules/Alert.d.ts +3 -2
- package/dist/components/molecules/Alert.d.ts.map +1 -1
- package/dist/components/molecules/DataGrid.d.ts +6 -5
- package/dist/components/molecules/DataGrid.d.ts.map +1 -1
- package/dist/components/molecules/DataList.d.ts +5 -4
- package/dist/components/molecules/DataList.d.ts.map +1 -1
- package/dist/components/molecules/NumberStepper.d.ts +3 -2
- package/dist/components/molecules/NumberStepper.d.ts.map +1 -1
- package/dist/components/molecules/PullToRefresh.d.ts +3 -2
- package/dist/components/molecules/PullToRefresh.d.ts.map +1 -1
- package/dist/components/molecules/RelationSelect.d.ts +3 -2
- package/dist/components/molecules/RelationSelect.d.ts.map +1 -1
- package/dist/components/molecules/RepeatableFormSection.d.ts +6 -5
- package/dist/components/molecules/RepeatableFormSection.d.ts.map +1 -1
- package/dist/components/molecules/SortableList.d.ts +2 -1
- package/dist/components/molecules/SortableList.d.ts.map +1 -1
- package/dist/components/molecules/StarRating.d.ts +3 -2
- package/dist/components/molecules/StarRating.d.ts.map +1 -1
- package/dist/components/molecules/SwipeableRow.d.ts +3 -2
- package/dist/components/molecules/SwipeableRow.d.ts.map +1 -1
- package/dist/components/molecules/Toast.d.ts +3 -2
- package/dist/components/molecules/Toast.d.ts.map +1 -1
- package/dist/components/molecules/index.js +9 -6
- package/dist/components/organisms/CardGrid.d.ts +6 -5
- package/dist/components/organisms/CardGrid.d.ts.map +1 -1
- package/dist/components/organisms/ComponentPatterns.d.ts.map +1 -1
- package/dist/components/organisms/ContentRenderer.d.ts.map +1 -1
- package/dist/components/organisms/DataTable.d.ts +2 -4
- package/dist/components/organisms/DataTable.d.ts.map +1 -1
- package/dist/components/organisms/DocumentViewer.d.ts.map +1 -1
- package/dist/components/organisms/DrawerSlot.d.ts +5 -4
- package/dist/components/organisms/DrawerSlot.d.ts.map +1 -1
- package/dist/components/organisms/FormSection.d.ts +8 -1
- package/dist/components/organisms/FormSection.d.ts.map +1 -1
- package/dist/components/organisms/Header.d.ts +3 -2
- package/dist/components/organisms/Header.d.ts.map +1 -1
- package/dist/components/organisms/LayoutPatterns.d.ts.map +1 -1
- package/dist/components/organisms/MasterDetail.d.ts.map +1 -1
- package/dist/components/organisms/MediaGallery.d.ts +2 -1
- package/dist/components/organisms/MediaGallery.d.ts.map +1 -1
- package/dist/components/organisms/ModalSlot.d.ts +5 -4
- package/dist/components/organisms/ModalSlot.d.ts.map +1 -1
- package/dist/components/organisms/PageHeader.d.ts +7 -0
- package/dist/components/organisms/PageHeader.d.ts.map +1 -1
- package/dist/components/organisms/SignaturePad.d.ts.map +1 -1
- package/dist/components/organisms/StatCard.d.ts +3 -2
- package/dist/components/organisms/StatCard.d.ts.map +1 -1
- package/dist/components/organisms/StateMachineView.d.ts.map +1 -1
- package/dist/components/organisms/Table.d.ts.map +1 -1
- package/dist/components/organisms/ToastSlot.d.ts +6 -5
- package/dist/components/organisms/ToastSlot.d.ts.map +1 -1
- package/dist/components/organisms/UISlotRenderer.d.ts +2 -1
- package/dist/components/organisms/UISlotRenderer.d.ts.map +1 -1
- package/dist/components/organisms/book/BookChapterView.d.ts +2 -1
- package/dist/components/organisms/book/BookChapterView.d.ts.map +1 -1
- package/dist/components/organisms/book/BookCoverPage.d.ts +2 -1
- package/dist/components/organisms/book/BookCoverPage.d.ts.map +1 -1
- package/dist/components/organisms/book/BookNavBar.d.ts +2 -1
- package/dist/components/organisms/book/BookNavBar.d.ts.map +1 -1
- package/dist/components/organisms/book/BookTableOfContents.d.ts +2 -1
- package/dist/components/organisms/book/BookTableOfContents.d.ts.map +1 -1
- package/dist/components/organisms/book/BookViewer.d.ts +2 -1
- package/dist/components/organisms/book/BookViewer.d.ts.map +1 -1
- package/dist/components/organisms/game/DialogueBox.d.ts.map +1 -1
- package/dist/components/organisms/game/InventoryPanel.d.ts.map +1 -1
- package/dist/components/organisms/game/physics-sim/SimulationCanvas.d.ts.map +1 -1
- package/dist/components/organisms/game/puzzles/sequencer/ActionPalette.d.ts.map +1 -1
- package/dist/components/organisms/game/puzzles/sequencer/ActionTile.d.ts.map +1 -1
- package/dist/components/organisms/game/puzzles/sequencer/SequenceBar.d.ts.map +1 -1
- package/dist/components/organisms/game/puzzles/state-architect/CodeView.d.ts.map +1 -1
- package/dist/components/organisms/game/puzzles/state-architect/StateArchitectBoard.d.ts.map +1 -1
- package/dist/components/organisms/game/puzzles/state-architect/StateNode.d.ts.map +1 -1
- package/dist/components/organisms/game/puzzles/state-architect/TransitionArrow.d.ts.map +1 -1
- package/dist/components/organisms/game/puzzles/state-architect/VariablePanel.d.ts.map +1 -1
- package/dist/components/organisms/index.d.ts +1 -1
- package/dist/components/organisms/index.d.ts.map +1 -1
- package/dist/components/organisms/index.js +14 -10
- package/dist/components/organisms/layout/DashboardGrid.d.ts +3 -2
- package/dist/components/organisms/layout/DashboardGrid.d.ts.map +1 -1
- package/dist/components/templates/BattleTemplate.d.ts.map +1 -1
- package/dist/components/templates/index.js +26 -0
- package/dist/components/templates/index.js.map +1 -0
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useTraitState.d.ts +3 -3
- package/dist/hooks/useTraitState.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -910
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +13 -6
- package/dist/chunk-5U5Z65ZO.js.map +0 -1
- package/dist/chunk-BFRVXKSP.js.map +0 -1
- package/dist/chunk-CA6Z3OTE.js.map +0 -1
- package/dist/chunk-ETD72PHO.js.map +0 -1
- package/dist/chunk-GMR5FKKB.js.map +0 -1
- package/dist/chunk-MLTSQPVN.js.map +0 -1
- package/dist/chunk-PBO6ZN2M.js.map +0 -1
- package/dist/chunk-QUFLYKWA.js.map +0 -1
|
@@ -0,0 +1,924 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BattleBoard,
|
|
3
|
+
CastleBoard,
|
|
4
|
+
GameHud,
|
|
5
|
+
GameMenu,
|
|
6
|
+
Header,
|
|
7
|
+
WorldMapBoard
|
|
8
|
+
} from "./chunk-I6UYSB5R.js";
|
|
9
|
+
import {
|
|
10
|
+
EmptyState
|
|
11
|
+
} from "./chunk-4GLV4XIP.js";
|
|
12
|
+
import {
|
|
13
|
+
Button,
|
|
14
|
+
Card,
|
|
15
|
+
ErrorState,
|
|
16
|
+
HStack,
|
|
17
|
+
LoadingState,
|
|
18
|
+
Typography,
|
|
19
|
+
VStack
|
|
20
|
+
} from "./chunk-A6AK75GP.js";
|
|
21
|
+
import {
|
|
22
|
+
useEventBus
|
|
23
|
+
} from "./chunk-YTVYMEKU.js";
|
|
24
|
+
import {
|
|
25
|
+
useTheme
|
|
26
|
+
} from "./chunk-CUAWHLEK.js";
|
|
27
|
+
|
|
28
|
+
// src/components/templates/DashboardLayout.tsx
|
|
29
|
+
import React from "react";
|
|
30
|
+
import {
|
|
31
|
+
View,
|
|
32
|
+
StyleSheet,
|
|
33
|
+
ScrollView,
|
|
34
|
+
SafeAreaView
|
|
35
|
+
} from "react-native";
|
|
36
|
+
var DashboardLayout = ({
|
|
37
|
+
children,
|
|
38
|
+
headerTitle,
|
|
39
|
+
headerActions = [],
|
|
40
|
+
showHeader = true,
|
|
41
|
+
style,
|
|
42
|
+
contentStyle,
|
|
43
|
+
scrollable = true,
|
|
44
|
+
isLoading,
|
|
45
|
+
error
|
|
46
|
+
}) => {
|
|
47
|
+
const theme = useTheme();
|
|
48
|
+
const Content = scrollable ? ScrollView : View;
|
|
49
|
+
if (isLoading) {
|
|
50
|
+
return /* @__PURE__ */ React.createElement(SafeAreaView, { style: [styles.container, { backgroundColor: theme.colors.background }, style] }, showHeader && /* @__PURE__ */ React.createElement(Header, { title: headerTitle, rightActions: headerActions }), /* @__PURE__ */ React.createElement(LoadingState, { message: "Loading..." }));
|
|
51
|
+
}
|
|
52
|
+
if (error) {
|
|
53
|
+
return /* @__PURE__ */ React.createElement(SafeAreaView, { style: [styles.container, { backgroundColor: theme.colors.background }, style] }, showHeader && /* @__PURE__ */ React.createElement(Header, { title: headerTitle, rightActions: headerActions }), /* @__PURE__ */ React.createElement(ErrorState, { message: error.message }));
|
|
54
|
+
}
|
|
55
|
+
return /* @__PURE__ */ React.createElement(SafeAreaView, { style: [styles.container, { backgroundColor: theme.colors.background }, style] }, showHeader && /* @__PURE__ */ React.createElement(Header, { title: headerTitle, rightActions: headerActions }), /* @__PURE__ */ React.createElement(
|
|
56
|
+
Content,
|
|
57
|
+
{
|
|
58
|
+
style: [styles.content, contentStyle],
|
|
59
|
+
contentContainerStyle: scrollable ? styles.scrollContent : void 0
|
|
60
|
+
},
|
|
61
|
+
children
|
|
62
|
+
));
|
|
63
|
+
};
|
|
64
|
+
var styles = StyleSheet.create({
|
|
65
|
+
container: {
|
|
66
|
+
flex: 1
|
|
67
|
+
},
|
|
68
|
+
content: {
|
|
69
|
+
flex: 1
|
|
70
|
+
},
|
|
71
|
+
scrollContent: {
|
|
72
|
+
flexGrow: 1,
|
|
73
|
+
padding: 16
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
DashboardLayout.displayName = "DashboardLayout";
|
|
77
|
+
|
|
78
|
+
// src/components/templates/AuthLayout.tsx
|
|
79
|
+
import React2 from "react";
|
|
80
|
+
import {
|
|
81
|
+
View as View2,
|
|
82
|
+
StyleSheet as StyleSheet2,
|
|
83
|
+
ScrollView as ScrollView2,
|
|
84
|
+
SafeAreaView as SafeAreaView2,
|
|
85
|
+
KeyboardAvoidingView,
|
|
86
|
+
Platform,
|
|
87
|
+
TouchableOpacity
|
|
88
|
+
} from "react-native";
|
|
89
|
+
var AuthLayout = ({
|
|
90
|
+
children,
|
|
91
|
+
title,
|
|
92
|
+
subtitle,
|
|
93
|
+
footer,
|
|
94
|
+
showBackButton = false,
|
|
95
|
+
onBack,
|
|
96
|
+
backAction,
|
|
97
|
+
style,
|
|
98
|
+
isLoading,
|
|
99
|
+
error
|
|
100
|
+
}) => {
|
|
101
|
+
const theme = useTheme();
|
|
102
|
+
const eventBus = useEventBus();
|
|
103
|
+
const handleBack = () => {
|
|
104
|
+
if (backAction) {
|
|
105
|
+
eventBus.emit(`UI:${backAction}`);
|
|
106
|
+
}
|
|
107
|
+
onBack?.();
|
|
108
|
+
};
|
|
109
|
+
if (isLoading) {
|
|
110
|
+
return /* @__PURE__ */ React2.createElement(SafeAreaView2, { style: [styles2.container, { backgroundColor: theme.colors.background }, style] }, /* @__PURE__ */ React2.createElement(LoadingState, { message: "Loading..." }));
|
|
111
|
+
}
|
|
112
|
+
if (error) {
|
|
113
|
+
return /* @__PURE__ */ React2.createElement(SafeAreaView2, { style: [styles2.container, { backgroundColor: theme.colors.background }, style] }, /* @__PURE__ */ React2.createElement(ErrorState, { message: error.message }));
|
|
114
|
+
}
|
|
115
|
+
return /* @__PURE__ */ React2.createElement(SafeAreaView2, { style: [styles2.container, { backgroundColor: theme.colors.background }, style] }, /* @__PURE__ */ React2.createElement(
|
|
116
|
+
KeyboardAvoidingView,
|
|
117
|
+
{
|
|
118
|
+
behavior: Platform.OS === "ios" ? "padding" : "height",
|
|
119
|
+
style: styles2.keyboardView
|
|
120
|
+
},
|
|
121
|
+
/* @__PURE__ */ React2.createElement(
|
|
122
|
+
ScrollView2,
|
|
123
|
+
{
|
|
124
|
+
contentContainerStyle: styles2.scrollContent,
|
|
125
|
+
keyboardShouldPersistTaps: "handled"
|
|
126
|
+
},
|
|
127
|
+
/* @__PURE__ */ React2.createElement(VStack, { spacing: 24, style: styles2.content }, showBackButton && /* @__PURE__ */ React2.createElement(TouchableOpacity, { onPress: handleBack, style: styles2.backButton }, /* @__PURE__ */ React2.createElement(Typography, { variant: "h4", style: { color: theme.colors.primary } }, "\u2190 Back")), /* @__PURE__ */ React2.createElement(VStack, { spacing: 8, align: "center" }, /* @__PURE__ */ React2.createElement(Typography, { variant: "h1", style: { color: theme.colors.foreground, textAlign: "center" } }, title), subtitle && /* @__PURE__ */ React2.createElement(Typography, { variant: "body", style: { color: theme.colors["muted-foreground"], textAlign: "center" } }, subtitle)), /* @__PURE__ */ React2.createElement(View2, { style: styles2.form }, children), footer && /* @__PURE__ */ React2.createElement(View2, { style: styles2.footer }, footer))
|
|
128
|
+
)
|
|
129
|
+
));
|
|
130
|
+
};
|
|
131
|
+
var styles2 = StyleSheet2.create({
|
|
132
|
+
container: {
|
|
133
|
+
flex: 1
|
|
134
|
+
},
|
|
135
|
+
keyboardView: {
|
|
136
|
+
flex: 1
|
|
137
|
+
},
|
|
138
|
+
scrollContent: {
|
|
139
|
+
flexGrow: 1,
|
|
140
|
+
justifyContent: "center"
|
|
141
|
+
},
|
|
142
|
+
content: {
|
|
143
|
+
padding: 24,
|
|
144
|
+
paddingTop: 40,
|
|
145
|
+
paddingBottom: 40
|
|
146
|
+
},
|
|
147
|
+
backButton: {
|
|
148
|
+
alignSelf: "flex-start"
|
|
149
|
+
},
|
|
150
|
+
form: {
|
|
151
|
+
width: "100%"
|
|
152
|
+
},
|
|
153
|
+
footer: {
|
|
154
|
+
marginTop: 16
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
AuthLayout.displayName = "AuthLayout";
|
|
158
|
+
|
|
159
|
+
// src/components/templates/GameShell.tsx
|
|
160
|
+
import React3 from "react";
|
|
161
|
+
import {
|
|
162
|
+
View as View3,
|
|
163
|
+
StyleSheet as StyleSheet3,
|
|
164
|
+
SafeAreaView as SafeAreaView3,
|
|
165
|
+
StatusBar
|
|
166
|
+
} from "react-native";
|
|
167
|
+
var GameShell = ({
|
|
168
|
+
children,
|
|
169
|
+
hud,
|
|
170
|
+
showHud = true,
|
|
171
|
+
header,
|
|
172
|
+
footer,
|
|
173
|
+
style,
|
|
174
|
+
gameAreaStyle,
|
|
175
|
+
backgroundColor,
|
|
176
|
+
isLoading,
|
|
177
|
+
error
|
|
178
|
+
}) => {
|
|
179
|
+
const theme = useTheme();
|
|
180
|
+
const eventBus = useEventBus();
|
|
181
|
+
if (isLoading) {
|
|
182
|
+
return /* @__PURE__ */ React3.createElement(
|
|
183
|
+
SafeAreaView3,
|
|
184
|
+
{
|
|
185
|
+
style: [
|
|
186
|
+
styles3.container,
|
|
187
|
+
{ backgroundColor: backgroundColor || theme.colors.background },
|
|
188
|
+
style
|
|
189
|
+
]
|
|
190
|
+
},
|
|
191
|
+
/* @__PURE__ */ React3.createElement(StatusBar, { barStyle: "light-content" }),
|
|
192
|
+
header,
|
|
193
|
+
/* @__PURE__ */ React3.createElement(View3, { style: styles3.loadingContainer }, /* @__PURE__ */ React3.createElement(LoadingState, { message: "Loading game..." }))
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
if (error) {
|
|
197
|
+
return /* @__PURE__ */ React3.createElement(
|
|
198
|
+
SafeAreaView3,
|
|
199
|
+
{
|
|
200
|
+
style: [
|
|
201
|
+
styles3.container,
|
|
202
|
+
{ backgroundColor: backgroundColor || theme.colors.background },
|
|
203
|
+
style
|
|
204
|
+
]
|
|
205
|
+
},
|
|
206
|
+
/* @__PURE__ */ React3.createElement(StatusBar, { barStyle: "light-content" }),
|
|
207
|
+
header,
|
|
208
|
+
/* @__PURE__ */ React3.createElement(View3, { style: styles3.loadingContainer }, /* @__PURE__ */ React3.createElement(
|
|
209
|
+
ErrorState,
|
|
210
|
+
{
|
|
211
|
+
message: error.message,
|
|
212
|
+
onRetry: () => eventBus.emit("UI:GAME_RETRY", {})
|
|
213
|
+
}
|
|
214
|
+
))
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
return /* @__PURE__ */ React3.createElement(
|
|
218
|
+
SafeAreaView3,
|
|
219
|
+
{
|
|
220
|
+
style: [
|
|
221
|
+
styles3.container,
|
|
222
|
+
{ backgroundColor: backgroundColor || theme.colors.background },
|
|
223
|
+
style
|
|
224
|
+
]
|
|
225
|
+
},
|
|
226
|
+
/* @__PURE__ */ React3.createElement(StatusBar, { barStyle: "light-content" }),
|
|
227
|
+
header && /* @__PURE__ */ React3.createElement(View3, { style: styles3.header }, header),
|
|
228
|
+
/* @__PURE__ */ React3.createElement(View3, { style: [styles3.gameArea, gameAreaStyle] }, children, showHud && hud && /* @__PURE__ */ React3.createElement(View3, { style: styles3.hudContainer }, /* @__PURE__ */ React3.createElement(
|
|
229
|
+
GameHud,
|
|
230
|
+
{
|
|
231
|
+
...hud,
|
|
232
|
+
style: { ...styles3.hud, ...hud.style }
|
|
233
|
+
}
|
|
234
|
+
))),
|
|
235
|
+
footer && /* @__PURE__ */ React3.createElement(View3, { style: styles3.footer }, footer)
|
|
236
|
+
);
|
|
237
|
+
};
|
|
238
|
+
var styles3 = StyleSheet3.create({
|
|
239
|
+
container: {
|
|
240
|
+
flex: 1
|
|
241
|
+
},
|
|
242
|
+
header: {
|
|
243
|
+
zIndex: 20
|
|
244
|
+
},
|
|
245
|
+
gameArea: {
|
|
246
|
+
flex: 1,
|
|
247
|
+
position: "relative"
|
|
248
|
+
},
|
|
249
|
+
hudContainer: {
|
|
250
|
+
position: "absolute",
|
|
251
|
+
top: 0,
|
|
252
|
+
left: 0,
|
|
253
|
+
right: 0,
|
|
254
|
+
bottom: 0,
|
|
255
|
+
pointerEvents: "box-none"
|
|
256
|
+
},
|
|
257
|
+
hud: {
|
|
258
|
+
pointerEvents: "auto"
|
|
259
|
+
},
|
|
260
|
+
footer: {
|
|
261
|
+
zIndex: 20
|
|
262
|
+
},
|
|
263
|
+
loadingContainer: {
|
|
264
|
+
flex: 1,
|
|
265
|
+
justifyContent: "center",
|
|
266
|
+
alignItems: "center"
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
GameShell.displayName = "GameShell";
|
|
270
|
+
|
|
271
|
+
// src/components/templates/BattleTemplate.tsx
|
|
272
|
+
import React4 from "react";
|
|
273
|
+
import {
|
|
274
|
+
View as View4,
|
|
275
|
+
StyleSheet as StyleSheet4
|
|
276
|
+
} from "react-native";
|
|
277
|
+
var BattleTemplate = ({
|
|
278
|
+
battleBoard,
|
|
279
|
+
hudStats,
|
|
280
|
+
menuOptions,
|
|
281
|
+
title,
|
|
282
|
+
showMenu = false,
|
|
283
|
+
style,
|
|
284
|
+
isLoading,
|
|
285
|
+
error,
|
|
286
|
+
entity,
|
|
287
|
+
onBattleAction,
|
|
288
|
+
onBattleEnd
|
|
289
|
+
}) => {
|
|
290
|
+
const theme = useTheme();
|
|
291
|
+
const eventBus = useEventBus();
|
|
292
|
+
const handleBattleAction = (action) => {
|
|
293
|
+
eventBus.emit("UI:BATTLE_ACTION", { action, entity });
|
|
294
|
+
onBattleAction?.(action);
|
|
295
|
+
};
|
|
296
|
+
const handleBattleEnd = (result) => {
|
|
297
|
+
eventBus.emit("UI:BATTLE_END", { result, entity });
|
|
298
|
+
onBattleEnd?.(result);
|
|
299
|
+
};
|
|
300
|
+
const handleMenuSelect = (option) => {
|
|
301
|
+
if (option.event) {
|
|
302
|
+
eventBus.emit(`UI:${option.event}`, { option, entity });
|
|
303
|
+
}
|
|
304
|
+
if (option.navigatesTo) {
|
|
305
|
+
eventBus.emit("UI:navigate", { to: option.navigatesTo });
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
if (isLoading) {
|
|
309
|
+
return /* @__PURE__ */ React4.createElement(View4, { style: [styles4.container, { backgroundColor: theme.colors.background }, style] }, /* @__PURE__ */ React4.createElement(LoadingState, { message: "Loading battle..." }));
|
|
310
|
+
}
|
|
311
|
+
if (error) {
|
|
312
|
+
return /* @__PURE__ */ React4.createElement(View4, { style: [styles4.container, { backgroundColor: theme.colors.background }, style] }, /* @__PURE__ */ React4.createElement(
|
|
313
|
+
ErrorState,
|
|
314
|
+
{
|
|
315
|
+
message: error.message,
|
|
316
|
+
onRetry: () => eventBus.emit("UI:BATTLE_RETRY", { entity })
|
|
317
|
+
}
|
|
318
|
+
));
|
|
319
|
+
}
|
|
320
|
+
const hasUnits = battleBoard.units && battleBoard.units.length > 0;
|
|
321
|
+
return /* @__PURE__ */ React4.createElement(View4, { style: [styles4.container, { backgroundColor: "#0f172a" }, style] }, title && /* @__PURE__ */ React4.createElement(View4, { style: styles4.header }, /* @__PURE__ */ React4.createElement(Typography, { variant: "h2", style: { color: "#fff" } }, title)), hudStats && hudStats.length > 0 && /* @__PURE__ */ React4.createElement(View4, { style: styles4.hudContainer }, /* @__PURE__ */ React4.createElement(GameHud, { stats: hudStats, position: "corners", transparent: true })), /* @__PURE__ */ React4.createElement(View4, { style: styles4.boardContainer }, hasUnits ? /* @__PURE__ */ React4.createElement(
|
|
322
|
+
BattleBoard,
|
|
323
|
+
{
|
|
324
|
+
...battleBoard,
|
|
325
|
+
onAction: handleBattleAction
|
|
326
|
+
}
|
|
327
|
+
) : /* @__PURE__ */ React4.createElement(
|
|
328
|
+
EmptyState,
|
|
329
|
+
{
|
|
330
|
+
message: "No battle units available",
|
|
331
|
+
icon: /* @__PURE__ */ React4.createElement(Typography, { variant: "h1" }, "\u2694\uFE0F")
|
|
332
|
+
}
|
|
333
|
+
)), /* @__PURE__ */ React4.createElement(View4, { style: styles4.controls }, /* @__PURE__ */ React4.createElement(HStack, { spacing: 8, justify: "center" }, /* @__PURE__ */ React4.createElement(
|
|
334
|
+
Button,
|
|
335
|
+
{
|
|
336
|
+
variant: "primary",
|
|
337
|
+
action: "BATTLE_ATTACK",
|
|
338
|
+
actionPayload: { entity },
|
|
339
|
+
onPress: () => handleBattleAction("attack")
|
|
340
|
+
},
|
|
341
|
+
"Attack"
|
|
342
|
+
), /* @__PURE__ */ React4.createElement(
|
|
343
|
+
Button,
|
|
344
|
+
{
|
|
345
|
+
variant: "secondary",
|
|
346
|
+
action: "BATTLE_DEFEND",
|
|
347
|
+
actionPayload: { entity },
|
|
348
|
+
onPress: () => handleBattleAction("defend")
|
|
349
|
+
},
|
|
350
|
+
"Defend"
|
|
351
|
+
), /* @__PURE__ */ React4.createElement(
|
|
352
|
+
Button,
|
|
353
|
+
{
|
|
354
|
+
variant: "ghost",
|
|
355
|
+
action: "BATTLE_FLEE",
|
|
356
|
+
actionPayload: { entity },
|
|
357
|
+
onPress: () => handleBattleEnd("flee")
|
|
358
|
+
},
|
|
359
|
+
"Flee"
|
|
360
|
+
))), showMenu && menuOptions && /* @__PURE__ */ React4.createElement(View4, { style: styles4.menuOverlay }, /* @__PURE__ */ React4.createElement(
|
|
361
|
+
GameMenu,
|
|
362
|
+
{
|
|
363
|
+
title: "Battle Menu",
|
|
364
|
+
options: menuOptions,
|
|
365
|
+
onSelect: handleMenuSelect
|
|
366
|
+
}
|
|
367
|
+
)));
|
|
368
|
+
};
|
|
369
|
+
var styles4 = StyleSheet4.create({
|
|
370
|
+
container: {
|
|
371
|
+
flex: 1
|
|
372
|
+
},
|
|
373
|
+
header: {
|
|
374
|
+
padding: 16,
|
|
375
|
+
alignItems: "center"
|
|
376
|
+
},
|
|
377
|
+
hudContainer: {
|
|
378
|
+
position: "absolute",
|
|
379
|
+
top: 60,
|
|
380
|
+
left: 0,
|
|
381
|
+
right: 0,
|
|
382
|
+
height: 80,
|
|
383
|
+
zIndex: 10,
|
|
384
|
+
pointerEvents: "none"
|
|
385
|
+
},
|
|
386
|
+
boardContainer: {
|
|
387
|
+
flex: 1,
|
|
388
|
+
padding: 16,
|
|
389
|
+
justifyContent: "center"
|
|
390
|
+
},
|
|
391
|
+
controls: {
|
|
392
|
+
padding: 16,
|
|
393
|
+
backgroundColor: "rgba(0,0,0,0.5)"
|
|
394
|
+
},
|
|
395
|
+
menuOverlay: {
|
|
396
|
+
position: "absolute",
|
|
397
|
+
top: 0,
|
|
398
|
+
left: 0,
|
|
399
|
+
right: 0,
|
|
400
|
+
bottom: 0,
|
|
401
|
+
zIndex: 100
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
BattleTemplate.displayName = "BattleTemplate";
|
|
405
|
+
|
|
406
|
+
// src/components/templates/CastleTemplate.tsx
|
|
407
|
+
import React5 from "react";
|
|
408
|
+
import {
|
|
409
|
+
View as View5,
|
|
410
|
+
StyleSheet as StyleSheet5,
|
|
411
|
+
ScrollView as ScrollView3
|
|
412
|
+
} from "react-native";
|
|
413
|
+
var CastleTemplate = ({
|
|
414
|
+
castleBoard,
|
|
415
|
+
hudStats,
|
|
416
|
+
actions,
|
|
417
|
+
title,
|
|
418
|
+
style,
|
|
419
|
+
isLoading,
|
|
420
|
+
error,
|
|
421
|
+
entity,
|
|
422
|
+
onEnterRoom,
|
|
423
|
+
onCastleAction
|
|
424
|
+
}) => {
|
|
425
|
+
const theme = useTheme();
|
|
426
|
+
const eventBus = useEventBus();
|
|
427
|
+
const handleEnterRoom = (roomId) => {
|
|
428
|
+
eventBus.emit("UI:CASTLE_ENTER_ROOM", { roomId, entity });
|
|
429
|
+
onEnterRoom?.(roomId);
|
|
430
|
+
};
|
|
431
|
+
const handleAction = (action) => {
|
|
432
|
+
eventBus.emit("UI:CASTLE_ACTION", { action, entity });
|
|
433
|
+
onCastleAction?.(action);
|
|
434
|
+
};
|
|
435
|
+
if (isLoading) {
|
|
436
|
+
return /* @__PURE__ */ React5.createElement(View5, { style: [styles5.container, { backgroundColor: theme.colors.background }, style] }, /* @__PURE__ */ React5.createElement(LoadingState, { message: "Loading castle..." }));
|
|
437
|
+
}
|
|
438
|
+
if (error) {
|
|
439
|
+
return /* @__PURE__ */ React5.createElement(View5, { style: [styles5.container, { backgroundColor: theme.colors.background }, style] }, /* @__PURE__ */ React5.createElement(
|
|
440
|
+
ErrorState,
|
|
441
|
+
{
|
|
442
|
+
message: error.message,
|
|
443
|
+
onRetry: () => eventBus.emit("UI:CASTLE_RETRY", { entity })
|
|
444
|
+
}
|
|
445
|
+
));
|
|
446
|
+
}
|
|
447
|
+
const hasRooms = castleBoard.rooms && castleBoard.rooms.length > 0;
|
|
448
|
+
return /* @__PURE__ */ React5.createElement(View5, { style: [styles5.container, { backgroundColor: "#1e293b" }, style] }, hudStats && hudStats.length > 0 && /* @__PURE__ */ React5.createElement(View5, { style: styles5.hudContainer }, /* @__PURE__ */ React5.createElement(GameHud, { stats: hudStats, position: "top", transparent: true })), /* @__PURE__ */ React5.createElement(
|
|
449
|
+
ScrollView3,
|
|
450
|
+
{
|
|
451
|
+
style: styles5.scrollView,
|
|
452
|
+
contentContainerStyle: styles5.scrollContent,
|
|
453
|
+
showsVerticalScrollIndicator: false
|
|
454
|
+
},
|
|
455
|
+
title && /* @__PURE__ */ React5.createElement(View5, { style: styles5.header }, /* @__PURE__ */ React5.createElement(Typography, { variant: "h2", style: { color: "#fbbf24" } }, title)),
|
|
456
|
+
/* @__PURE__ */ React5.createElement(View5, { style: styles5.boardContainer }, hasRooms ? /* @__PURE__ */ React5.createElement(
|
|
457
|
+
CastleBoard,
|
|
458
|
+
{
|
|
459
|
+
...castleBoard,
|
|
460
|
+
onSelectRoom: handleEnterRoom
|
|
461
|
+
}
|
|
462
|
+
) : /* @__PURE__ */ React5.createElement(
|
|
463
|
+
EmptyState,
|
|
464
|
+
{
|
|
465
|
+
message: "No castle rooms available",
|
|
466
|
+
icon: /* @__PURE__ */ React5.createElement(Typography, { variant: "h1" }, "\u{1F3F0}")
|
|
467
|
+
}
|
|
468
|
+
)),
|
|
469
|
+
actions && actions.length > 0 && /* @__PURE__ */ React5.createElement(View5, { style: styles5.actionsContainer }, /* @__PURE__ */ React5.createElement(HStack, { spacing: 8, justify: "center", style: styles5.actions }, actions.map((action, index) => /* @__PURE__ */ React5.createElement(
|
|
470
|
+
Button,
|
|
471
|
+
{
|
|
472
|
+
key: index,
|
|
473
|
+
variant: action.variant || "default",
|
|
474
|
+
action: action.event,
|
|
475
|
+
actionPayload: { entity },
|
|
476
|
+
onPress: () => handleAction(action.event)
|
|
477
|
+
},
|
|
478
|
+
action.label
|
|
479
|
+
))))
|
|
480
|
+
));
|
|
481
|
+
};
|
|
482
|
+
var styles5 = StyleSheet5.create({
|
|
483
|
+
container: {
|
|
484
|
+
flex: 1
|
|
485
|
+
},
|
|
486
|
+
hudContainer: {
|
|
487
|
+
position: "absolute",
|
|
488
|
+
top: 0,
|
|
489
|
+
left: 0,
|
|
490
|
+
right: 0,
|
|
491
|
+
zIndex: 10
|
|
492
|
+
},
|
|
493
|
+
scrollView: {
|
|
494
|
+
flex: 1
|
|
495
|
+
},
|
|
496
|
+
scrollContent: {
|
|
497
|
+
paddingTop: 80,
|
|
498
|
+
paddingBottom: 24
|
|
499
|
+
},
|
|
500
|
+
header: {
|
|
501
|
+
padding: 16,
|
|
502
|
+
alignItems: "center"
|
|
503
|
+
},
|
|
504
|
+
boardContainer: {
|
|
505
|
+
padding: 16
|
|
506
|
+
},
|
|
507
|
+
actionsContainer: {
|
|
508
|
+
padding: 16
|
|
509
|
+
},
|
|
510
|
+
actions: {
|
|
511
|
+
flexWrap: "wrap"
|
|
512
|
+
}
|
|
513
|
+
});
|
|
514
|
+
CastleTemplate.displayName = "CastleTemplate";
|
|
515
|
+
|
|
516
|
+
// src/components/templates/WorldMapTemplate.tsx
|
|
517
|
+
import React6 from "react";
|
|
518
|
+
import {
|
|
519
|
+
View as View6,
|
|
520
|
+
StyleSheet as StyleSheet6
|
|
521
|
+
} from "react-native";
|
|
522
|
+
var WorldMapTemplate = ({
|
|
523
|
+
worldMapBoard,
|
|
524
|
+
hudStats,
|
|
525
|
+
navigationActions,
|
|
526
|
+
title,
|
|
527
|
+
act,
|
|
528
|
+
style,
|
|
529
|
+
isLoading,
|
|
530
|
+
error,
|
|
531
|
+
entity,
|
|
532
|
+
onSelectNode,
|
|
533
|
+
onMapAction
|
|
534
|
+
}) => {
|
|
535
|
+
const theme = useTheme();
|
|
536
|
+
const eventBus = useEventBus();
|
|
537
|
+
const handleSelectNode = (nodeId) => {
|
|
538
|
+
eventBus.emit("UI:MAP_SELECT_NODE", { nodeId, entity });
|
|
539
|
+
onSelectNode?.(nodeId);
|
|
540
|
+
};
|
|
541
|
+
const handleMapAction = (action, targetNodeId) => {
|
|
542
|
+
eventBus.emit("UI:MAP_ACTION", { action, targetNodeId, entity });
|
|
543
|
+
onMapAction?.(action, targetNodeId);
|
|
544
|
+
};
|
|
545
|
+
if (isLoading) {
|
|
546
|
+
return /* @__PURE__ */ React6.createElement(View6, { style: [styles6.container, { backgroundColor: theme.colors.background }, style] }, /* @__PURE__ */ React6.createElement(LoadingState, { message: "Loading world map..." }));
|
|
547
|
+
}
|
|
548
|
+
if (error) {
|
|
549
|
+
return /* @__PURE__ */ React6.createElement(View6, { style: [styles6.container, { backgroundColor: theme.colors.background }, style] }, /* @__PURE__ */ React6.createElement(
|
|
550
|
+
ErrorState,
|
|
551
|
+
{
|
|
552
|
+
message: error.message,
|
|
553
|
+
onRetry: () => eventBus.emit("UI:MAP_RETRY", { entity })
|
|
554
|
+
}
|
|
555
|
+
));
|
|
556
|
+
}
|
|
557
|
+
const hasNodes = worldMapBoard.nodes && worldMapBoard.nodes.length > 0;
|
|
558
|
+
return /* @__PURE__ */ React6.createElement(View6, { style: [styles6.container, { backgroundColor: "#0f172a" }, style] }, hudStats && hudStats.length > 0 && /* @__PURE__ */ React6.createElement(View6, { style: styles6.hudContainer }, /* @__PURE__ */ React6.createElement(GameHud, { stats: hudStats, position: "corners", transparent: true })), (title || act) && /* @__PURE__ */ React6.createElement(View6, { style: styles6.header }, title && /* @__PURE__ */ React6.createElement(Typography, { variant: "h2", style: { color: "#fff" } }, title), act && /* @__PURE__ */ React6.createElement(Typography, { variant: "caption", style: { color: "#9ca3af" } }, act)), /* @__PURE__ */ React6.createElement(View6, { style: styles6.mapContainer }, hasNodes ? /* @__PURE__ */ React6.createElement(
|
|
559
|
+
WorldMapBoard,
|
|
560
|
+
{
|
|
561
|
+
...worldMapBoard,
|
|
562
|
+
title: worldMapBoard.title || title,
|
|
563
|
+
act: worldMapBoard.act || act,
|
|
564
|
+
onSelectNode: handleSelectNode
|
|
565
|
+
}
|
|
566
|
+
) : /* @__PURE__ */ React6.createElement(
|
|
567
|
+
EmptyState,
|
|
568
|
+
{
|
|
569
|
+
message: "No map locations available",
|
|
570
|
+
icon: /* @__PURE__ */ React6.createElement(Typography, { variant: "h1" }, "\u{1F5FA}\uFE0F")
|
|
571
|
+
}
|
|
572
|
+
)), navigationActions && navigationActions.length > 0 && /* @__PURE__ */ React6.createElement(View6, { style: styles6.actionsContainer }, /* @__PURE__ */ React6.createElement(HStack, { spacing: 8, justify: "center", style: styles6.actions }, navigationActions.map((action, index) => /* @__PURE__ */ React6.createElement(
|
|
573
|
+
Button,
|
|
574
|
+
{
|
|
575
|
+
key: index,
|
|
576
|
+
variant: action.variant || "default",
|
|
577
|
+
action: action.event,
|
|
578
|
+
actionPayload: { entity, targetNodeId: action.targetNodeId },
|
|
579
|
+
onPress: () => handleMapAction(action.event, action.targetNodeId)
|
|
580
|
+
},
|
|
581
|
+
action.label
|
|
582
|
+
)))));
|
|
583
|
+
};
|
|
584
|
+
var styles6 = StyleSheet6.create({
|
|
585
|
+
container: {
|
|
586
|
+
flex: 1
|
|
587
|
+
},
|
|
588
|
+
hudContainer: {
|
|
589
|
+
position: "absolute",
|
|
590
|
+
top: 0,
|
|
591
|
+
left: 0,
|
|
592
|
+
right: 0,
|
|
593
|
+
bottom: 0,
|
|
594
|
+
pointerEvents: "none",
|
|
595
|
+
zIndex: 10
|
|
596
|
+
},
|
|
597
|
+
header: {
|
|
598
|
+
padding: 16,
|
|
599
|
+
alignItems: "center",
|
|
600
|
+
zIndex: 20
|
|
601
|
+
},
|
|
602
|
+
mapContainer: {
|
|
603
|
+
flex: 1,
|
|
604
|
+
padding: 16
|
|
605
|
+
},
|
|
606
|
+
actionsContainer: {
|
|
607
|
+
padding: 16,
|
|
608
|
+
backgroundColor: "rgba(0,0,0,0.5)",
|
|
609
|
+
zIndex: 20
|
|
610
|
+
},
|
|
611
|
+
actions: {
|
|
612
|
+
flexWrap: "wrap"
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
WorldMapTemplate.displayName = "WorldMapTemplate";
|
|
616
|
+
|
|
617
|
+
// src/components/templates/CounterTemplate.tsx
|
|
618
|
+
import React7, { useState, useCallback } from "react";
|
|
619
|
+
import {
|
|
620
|
+
View as View7,
|
|
621
|
+
StyleSheet as StyleSheet7
|
|
622
|
+
} from "react-native";
|
|
623
|
+
var CounterTemplate = ({
|
|
624
|
+
initialCount = 0,
|
|
625
|
+
step = 1,
|
|
626
|
+
min = Number.MIN_SAFE_INTEGER,
|
|
627
|
+
max = Number.MAX_SAFE_INTEGER,
|
|
628
|
+
title = "Counter",
|
|
629
|
+
showReset = true,
|
|
630
|
+
style,
|
|
631
|
+
cardStyle,
|
|
632
|
+
isLoading,
|
|
633
|
+
error,
|
|
634
|
+
entity,
|
|
635
|
+
onCountChange,
|
|
636
|
+
onReset
|
|
637
|
+
}) => {
|
|
638
|
+
const theme = useTheme();
|
|
639
|
+
const eventBus = useEventBus();
|
|
640
|
+
const [count, setCount] = useState(initialCount);
|
|
641
|
+
const handleIncrement = useCallback(() => {
|
|
642
|
+
setCount((prev) => {
|
|
643
|
+
const newCount = Math.min(prev + step, max);
|
|
644
|
+
eventBus.emit("UI:COUNTER_INCREMENT", { count: newCount, entity });
|
|
645
|
+
onCountChange?.(newCount);
|
|
646
|
+
return newCount;
|
|
647
|
+
});
|
|
648
|
+
}, [step, max, entity, onCountChange, eventBus]);
|
|
649
|
+
const handleDecrement = useCallback(() => {
|
|
650
|
+
setCount((prev) => {
|
|
651
|
+
const newCount = Math.max(prev - step, min);
|
|
652
|
+
eventBus.emit("UI:COUNTER_DECREMENT", { count: newCount, entity });
|
|
653
|
+
onCountChange?.(newCount);
|
|
654
|
+
return newCount;
|
|
655
|
+
});
|
|
656
|
+
}, [step, min, entity, onCountChange, eventBus]);
|
|
657
|
+
const handleReset = useCallback(() => {
|
|
658
|
+
setCount(initialCount);
|
|
659
|
+
eventBus.emit("UI:COUNTER_RESET", { count: initialCount, entity });
|
|
660
|
+
onReset?.();
|
|
661
|
+
onCountChange?.(initialCount);
|
|
662
|
+
}, [initialCount, entity, onReset, onCountChange, eventBus]);
|
|
663
|
+
if (isLoading) {
|
|
664
|
+
return /* @__PURE__ */ React7.createElement(View7, { style: [styles7.container, style] }, /* @__PURE__ */ React7.createElement(LoadingState, { message: "Loading counter..." }));
|
|
665
|
+
}
|
|
666
|
+
if (error) {
|
|
667
|
+
return /* @__PURE__ */ React7.createElement(View7, { style: [styles7.container, style] }, /* @__PURE__ */ React7.createElement(
|
|
668
|
+
ErrorState,
|
|
669
|
+
{
|
|
670
|
+
message: error.message,
|
|
671
|
+
onRetry: () => eventBus.emit("UI:COUNTER_RETRY", { entity })
|
|
672
|
+
}
|
|
673
|
+
));
|
|
674
|
+
}
|
|
675
|
+
const isAtMin = count <= min;
|
|
676
|
+
const isAtMax = count >= max;
|
|
677
|
+
return /* @__PURE__ */ React7.createElement(View7, { style: [styles7.container, { backgroundColor: theme.colors.background }, style] }, /* @__PURE__ */ React7.createElement(Card, { style: [styles7.card, cardStyle || {}] }, /* @__PURE__ */ React7.createElement(VStack, { spacing: 24, align: "center" }, /* @__PURE__ */ React7.createElement(Typography, { variant: "h3" }, title), /* @__PURE__ */ React7.createElement(View7, { style: styles7.countDisplay }, /* @__PURE__ */ React7.createElement(
|
|
678
|
+
Typography,
|
|
679
|
+
{
|
|
680
|
+
variant: "h1",
|
|
681
|
+
style: [
|
|
682
|
+
styles7.countText,
|
|
683
|
+
{ color: count > 0 ? theme.colors.success : count < 0 ? theme.colors.error : theme.colors.foreground }
|
|
684
|
+
]
|
|
685
|
+
},
|
|
686
|
+
count
|
|
687
|
+
)), /* @__PURE__ */ React7.createElement(HStack, { spacing: 16, align: "center" }, /* @__PURE__ */ React7.createElement(
|
|
688
|
+
Button,
|
|
689
|
+
{
|
|
690
|
+
variant: "secondary",
|
|
691
|
+
action: "COUNTER_DECREMENT",
|
|
692
|
+
actionPayload: { entity, step },
|
|
693
|
+
onPress: handleDecrement,
|
|
694
|
+
disabled: isAtMin
|
|
695
|
+
},
|
|
696
|
+
"-",
|
|
697
|
+
step
|
|
698
|
+
), showReset && /* @__PURE__ */ React7.createElement(
|
|
699
|
+
Button,
|
|
700
|
+
{
|
|
701
|
+
variant: "ghost",
|
|
702
|
+
action: "COUNTER_RESET",
|
|
703
|
+
actionPayload: { entity },
|
|
704
|
+
onPress: handleReset,
|
|
705
|
+
disabled: count === initialCount
|
|
706
|
+
},
|
|
707
|
+
"Reset"
|
|
708
|
+
), /* @__PURE__ */ React7.createElement(
|
|
709
|
+
Button,
|
|
710
|
+
{
|
|
711
|
+
variant: "primary",
|
|
712
|
+
action: "COUNTER_INCREMENT",
|
|
713
|
+
actionPayload: { entity, step },
|
|
714
|
+
onPress: handleIncrement,
|
|
715
|
+
disabled: isAtMax
|
|
716
|
+
},
|
|
717
|
+
"+",
|
|
718
|
+
step
|
|
719
|
+
)), /* @__PURE__ */ React7.createElement(Typography, { variant: "caption", color: theme.colors["muted-foreground"] }, "Min: ", min, " | Max: ", max, " | Step: ", step))));
|
|
720
|
+
};
|
|
721
|
+
var styles7 = StyleSheet7.create({
|
|
722
|
+
container: {
|
|
723
|
+
flex: 1,
|
|
724
|
+
justifyContent: "center",
|
|
725
|
+
alignItems: "center",
|
|
726
|
+
padding: 16
|
|
727
|
+
},
|
|
728
|
+
card: {
|
|
729
|
+
padding: 32,
|
|
730
|
+
minWidth: 280,
|
|
731
|
+
maxWidth: 400,
|
|
732
|
+
width: "100%"
|
|
733
|
+
},
|
|
734
|
+
countDisplay: {
|
|
735
|
+
paddingVertical: 24,
|
|
736
|
+
paddingHorizontal: 48,
|
|
737
|
+
backgroundColor: "rgba(0,0,0,0.05)",
|
|
738
|
+
borderRadius: 12
|
|
739
|
+
},
|
|
740
|
+
countText: {
|
|
741
|
+
fontSize: 64,
|
|
742
|
+
fontWeight: "700"
|
|
743
|
+
}
|
|
744
|
+
});
|
|
745
|
+
CounterTemplate.displayName = "CounterTemplate";
|
|
746
|
+
|
|
747
|
+
// src/components/templates/GameTemplate.tsx
|
|
748
|
+
import React8 from "react";
|
|
749
|
+
import {
|
|
750
|
+
View as View8,
|
|
751
|
+
StyleSheet as StyleSheet8,
|
|
752
|
+
SafeAreaView as SafeAreaView4
|
|
753
|
+
} from "react-native";
|
|
754
|
+
var GameTemplate = ({
|
|
755
|
+
children,
|
|
756
|
+
title,
|
|
757
|
+
subtitle,
|
|
758
|
+
hud,
|
|
759
|
+
showHud = true,
|
|
760
|
+
menu,
|
|
761
|
+
showMenu = false,
|
|
762
|
+
actions,
|
|
763
|
+
style,
|
|
764
|
+
contentStyle,
|
|
765
|
+
backgroundColor,
|
|
766
|
+
isLoading,
|
|
767
|
+
error,
|
|
768
|
+
entity,
|
|
769
|
+
emptyMessage = "No game content available",
|
|
770
|
+
onAction
|
|
771
|
+
}) => {
|
|
772
|
+
const theme = useTheme();
|
|
773
|
+
const eventBus = useEventBus();
|
|
774
|
+
const handleAction = (action, payload) => {
|
|
775
|
+
eventBus.emit(`UI:${action}`, { ...payload, entity });
|
|
776
|
+
onAction?.(action, payload);
|
|
777
|
+
};
|
|
778
|
+
if (isLoading) {
|
|
779
|
+
return /* @__PURE__ */ React8.createElement(
|
|
780
|
+
SafeAreaView4,
|
|
781
|
+
{
|
|
782
|
+
style: [
|
|
783
|
+
styles8.container,
|
|
784
|
+
{ backgroundColor: backgroundColor || theme.colors.background },
|
|
785
|
+
style
|
|
786
|
+
]
|
|
787
|
+
},
|
|
788
|
+
/* @__PURE__ */ React8.createElement(LoadingState, { message: "Loading game..." })
|
|
789
|
+
);
|
|
790
|
+
}
|
|
791
|
+
if (error) {
|
|
792
|
+
return /* @__PURE__ */ React8.createElement(
|
|
793
|
+
SafeAreaView4,
|
|
794
|
+
{
|
|
795
|
+
style: [
|
|
796
|
+
styles8.container,
|
|
797
|
+
{ backgroundColor: backgroundColor || theme.colors.background },
|
|
798
|
+
style
|
|
799
|
+
]
|
|
800
|
+
},
|
|
801
|
+
/* @__PURE__ */ React8.createElement(
|
|
802
|
+
ErrorState,
|
|
803
|
+
{
|
|
804
|
+
message: error.message,
|
|
805
|
+
onRetry: () => handleAction("GAME_RETRY")
|
|
806
|
+
}
|
|
807
|
+
)
|
|
808
|
+
);
|
|
809
|
+
}
|
|
810
|
+
const shouldShowMenu = showMenu || !children && menu;
|
|
811
|
+
if (shouldShowMenu && menu) {
|
|
812
|
+
return /* @__PURE__ */ React8.createElement(
|
|
813
|
+
SafeAreaView4,
|
|
814
|
+
{
|
|
815
|
+
style: [
|
|
816
|
+
styles8.container,
|
|
817
|
+
{ backgroundColor: backgroundColor || "#0f172a" },
|
|
818
|
+
style
|
|
819
|
+
]
|
|
820
|
+
},
|
|
821
|
+
/* @__PURE__ */ React8.createElement(
|
|
822
|
+
GameMenu,
|
|
823
|
+
{
|
|
824
|
+
title: menu.title || title || "Game Menu",
|
|
825
|
+
subtitle: menu.subtitle || subtitle,
|
|
826
|
+
options: menu.options || menu.menuItems || [],
|
|
827
|
+
onSelect: (option) => {
|
|
828
|
+
if (option.event) {
|
|
829
|
+
handleAction(option.event, { option });
|
|
830
|
+
}
|
|
831
|
+
if (option.navigatesTo) {
|
|
832
|
+
handleAction("navigate", { to: option.navigatesTo });
|
|
833
|
+
}
|
|
834
|
+
menu.onSelect?.(option);
|
|
835
|
+
},
|
|
836
|
+
background: menu.background,
|
|
837
|
+
logo: menu.logo,
|
|
838
|
+
style: menu.style
|
|
839
|
+
}
|
|
840
|
+
)
|
|
841
|
+
);
|
|
842
|
+
}
|
|
843
|
+
const hasContent = React8.Children.count(children) > 0;
|
|
844
|
+
return /* @__PURE__ */ React8.createElement(
|
|
845
|
+
SafeAreaView4,
|
|
846
|
+
{
|
|
847
|
+
style: [
|
|
848
|
+
styles8.container,
|
|
849
|
+
{ backgroundColor: backgroundColor || theme.colors.background },
|
|
850
|
+
style
|
|
851
|
+
]
|
|
852
|
+
},
|
|
853
|
+
showHud && hud && /* @__PURE__ */ React8.createElement(View8, { style: styles8.hudOverlay }, /* @__PURE__ */ React8.createElement(GameHud, { ...hud })),
|
|
854
|
+
(title || subtitle) && /* @__PURE__ */ React8.createElement(View8, { style: styles8.header }, title && /* @__PURE__ */ React8.createElement(Typography, { variant: "h2", style: styles8.title }, title), subtitle && /* @__PURE__ */ React8.createElement(Typography, { variant: "body", color: theme.colors["muted-foreground"] }, subtitle)),
|
|
855
|
+
/* @__PURE__ */ React8.createElement(View8, { style: [styles8.content, contentStyle] }, hasContent ? children : /* @__PURE__ */ React8.createElement(
|
|
856
|
+
EmptyState,
|
|
857
|
+
{
|
|
858
|
+
message: emptyMessage,
|
|
859
|
+
icon: /* @__PURE__ */ React8.createElement(Typography, { variant: "h1" }, "\u{1F3AE}")
|
|
860
|
+
}
|
|
861
|
+
)),
|
|
862
|
+
actions && actions.length > 0 && /* @__PURE__ */ React8.createElement(View8, { style: styles8.actionBar }, /* @__PURE__ */ React8.createElement(Card, { variant: "elevated", style: styles8.actionCard }, /* @__PURE__ */ React8.createElement(HStack, { spacing: 8, justify: "center", style: styles8.actions }, actions.map((action, index) => /* @__PURE__ */ React8.createElement(
|
|
863
|
+
Button,
|
|
864
|
+
{
|
|
865
|
+
key: index,
|
|
866
|
+
variant: action.variant || "default",
|
|
867
|
+
action: action.event,
|
|
868
|
+
actionPayload: { ...action.payload, entity },
|
|
869
|
+
onPress: () => handleAction(action.event, action.payload),
|
|
870
|
+
disabled: action.disabled
|
|
871
|
+
},
|
|
872
|
+
action.label
|
|
873
|
+
)))))
|
|
874
|
+
);
|
|
875
|
+
};
|
|
876
|
+
var styles8 = StyleSheet8.create({
|
|
877
|
+
container: {
|
|
878
|
+
flex: 1
|
|
879
|
+
},
|
|
880
|
+
hudOverlay: {
|
|
881
|
+
position: "absolute",
|
|
882
|
+
top: 0,
|
|
883
|
+
left: 0,
|
|
884
|
+
right: 0,
|
|
885
|
+
bottom: 0,
|
|
886
|
+
pointerEvents: "box-none",
|
|
887
|
+
zIndex: 10
|
|
888
|
+
},
|
|
889
|
+
header: {
|
|
890
|
+
padding: 16,
|
|
891
|
+
alignItems: "center",
|
|
892
|
+
zIndex: 20
|
|
893
|
+
},
|
|
894
|
+
title: {
|
|
895
|
+
fontWeight: "700"
|
|
896
|
+
},
|
|
897
|
+
content: {
|
|
898
|
+
flex: 1,
|
|
899
|
+
padding: 16
|
|
900
|
+
},
|
|
901
|
+
actionBar: {
|
|
902
|
+
padding: 16,
|
|
903
|
+
zIndex: 20
|
|
904
|
+
},
|
|
905
|
+
actionCard: {
|
|
906
|
+
padding: 12
|
|
907
|
+
},
|
|
908
|
+
actions: {
|
|
909
|
+
flexWrap: "wrap"
|
|
910
|
+
}
|
|
911
|
+
});
|
|
912
|
+
GameTemplate.displayName = "GameTemplate";
|
|
913
|
+
|
|
914
|
+
export {
|
|
915
|
+
DashboardLayout,
|
|
916
|
+
AuthLayout,
|
|
917
|
+
GameShell,
|
|
918
|
+
BattleTemplate,
|
|
919
|
+
CastleTemplate,
|
|
920
|
+
WorldMapTemplate,
|
|
921
|
+
CounterTemplate,
|
|
922
|
+
GameTemplate
|
|
923
|
+
};
|
|
924
|
+
//# sourceMappingURL=chunk-UIU7NWN2.js.map
|