@tastic/shell 0.8.1 → 0.8.3
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.md +1 -1
- package/dist/index.js +168 -154
- package/dist/index.mjs +128 -114
- package/package.json +2 -2
- package/src/RootLayout.tsx +38 -35
- package/src/components/WindowControlsInsets.tsx +19 -0
- package/src/components/segmentTheme.ts +14 -0
- package/src/screens/HomeScreen.tsx +4 -3
- package/src/screens/StatsScreen.tsx +10 -5
package/dist/index.js
CHANGED
|
@@ -108,10 +108,10 @@ var import_profile3 = require("@tastic/profile");
|
|
|
108
108
|
var Haptics = __toESM(require("expo-haptics"));
|
|
109
109
|
var import_expo_router = require("expo-router");
|
|
110
110
|
var import_react8 = require("react");
|
|
111
|
-
var
|
|
111
|
+
var import_react_native3 = require("react-native");
|
|
112
112
|
var import_react_native_gesture_handler = require("react-native-gesture-handler");
|
|
113
113
|
var RNPaper2 = __toESM(require("react-native-paper"));
|
|
114
|
-
var
|
|
114
|
+
var import_react_native_safe_area_context2 = require("react-native-safe-area-context");
|
|
115
115
|
|
|
116
116
|
// src/components/Fonts.tsx
|
|
117
117
|
var import_vector_icons = require("@expo/vector-icons");
|
|
@@ -309,6 +309,16 @@ function UpdateDialog() {
|
|
|
309
309
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_chrome.UpdateDialog, { onError });
|
|
310
310
|
}
|
|
311
311
|
|
|
312
|
+
// src/components/WindowControlsInsets.tsx
|
|
313
|
+
var import_react_native2 = require("react-native");
|
|
314
|
+
var import_react_native_safe_area_context = require("react-native-safe-area-context");
|
|
315
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
316
|
+
function WindowControlsInsets({ children }) {
|
|
317
|
+
const vertical = (0, import_react_native_safe_area_context.useSafeAreaInsets)({ cornerAdaptation: "vertical" });
|
|
318
|
+
if (import_react_native2.Platform.OS !== "ios" || !import_react_native2.Platform.isPad) return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children });
|
|
319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native_safe_area_context.SafeAreaInsetsContext.Provider, { value: vertical, children });
|
|
320
|
+
}
|
|
321
|
+
|
|
312
322
|
// src/hooks/useLastActiveGame.tsx
|
|
313
323
|
var import_react6 = require("react");
|
|
314
324
|
var import_react_redux4 = require("react-redux");
|
|
@@ -320,7 +330,7 @@ var lastActiveGameActions = actions;
|
|
|
320
330
|
var lastActiveGameSlice_default = reducer;
|
|
321
331
|
|
|
322
332
|
// src/hooks/useLastActiveGame.tsx
|
|
323
|
-
var
|
|
333
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
324
334
|
var LastActiveGameContext = (0, import_react6.createContext)(null);
|
|
325
335
|
function LastActiveGameProvider({ children }) {
|
|
326
336
|
const store = (0, import_react_redux4.useStore)();
|
|
@@ -353,7 +363,7 @@ function LastActiveGameProvider({ children }) {
|
|
|
353
363
|
}),
|
|
354
364
|
[dispatch]
|
|
355
365
|
);
|
|
356
|
-
return /* @__PURE__ */ (0,
|
|
366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(LastActiveGameContext.Provider, { value, children });
|
|
357
367
|
}
|
|
358
368
|
function useLastActiveGame() {
|
|
359
369
|
const ctx = (0, import_react6.useContext)(LastActiveGameContext);
|
|
@@ -374,7 +384,7 @@ var profileSelectionActions = actions2;
|
|
|
374
384
|
var profileSelectionSlice_default = reducer2;
|
|
375
385
|
|
|
376
386
|
// src/hooks/useProfiles.tsx
|
|
377
|
-
var
|
|
387
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
378
388
|
var SHARED_GROUP_ID = "group.com.infinitetoken.tastic";
|
|
379
389
|
var ProfilesContext = (0, import_react7.createContext)(null);
|
|
380
390
|
function ProfilesProvider({ children }) {
|
|
@@ -434,7 +444,7 @@ function ProfilesProvider({ children }) {
|
|
|
434
444
|
},
|
|
435
445
|
[dispatch]
|
|
436
446
|
);
|
|
437
|
-
return /* @__PURE__ */ (0,
|
|
447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ProfilesContext.Provider, { value: { profiles, lastSelected, loaded, createProfile, updateProfile, deleteProfile, selectProfile }, children });
|
|
438
448
|
}
|
|
439
449
|
function useProfiles() {
|
|
440
450
|
const ctx = (0, import_react7.useContext)(ProfilesContext);
|
|
@@ -443,7 +453,7 @@ function useProfiles() {
|
|
|
443
453
|
}
|
|
444
454
|
|
|
445
455
|
// src/RootLayout.tsx
|
|
446
|
-
var
|
|
456
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
447
457
|
var PLAY_OPTIONS = { statusBarHidden: true };
|
|
448
458
|
var KEEP_STATUS_BAR_OPTIONS = {};
|
|
449
459
|
var TRANSPARENT_CONTENT = { backgroundColor: "transparent" };
|
|
@@ -456,7 +466,7 @@ function AppStack() {
|
|
|
456
466
|
const rootBackground = (0, import_core4.useThemedRootBackground)(darkRoot, false);
|
|
457
467
|
const statusBarStyle = darkRoot ? "light" : "dark";
|
|
458
468
|
const packOptions = (pack.useScreenOptions ?? noScreenOptions)();
|
|
459
|
-
const backdropOptions = Backdrop ? { contentStyle: TRANSPARENT_CONTENT, animation:
|
|
469
|
+
const backdropOptions = Backdrop ? { contentStyle: TRANSPARENT_CONTENT, animation: import_react_native3.Platform.select({ android: "fade" }) } : void 0;
|
|
460
470
|
const playOptions = (0, import_react8.useCallback)(
|
|
461
471
|
({ route }) => {
|
|
462
472
|
const id = route.params?.game;
|
|
@@ -469,63 +479,63 @@ function AppStack() {
|
|
|
469
479
|
const base = darkRoot ? import_expo_router.DarkTheme : import_expo_router.DefaultTheme;
|
|
470
480
|
return { ...base, colors: { ...base.colors, background: navigationBackground } };
|
|
471
481
|
}, [darkRoot, navigationBackground]);
|
|
472
|
-
const stack = /* @__PURE__ */ (0,
|
|
473
|
-
/* @__PURE__ */ (0,
|
|
474
|
-
/* @__PURE__ */ (0,
|
|
482
|
+
const stack = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_expo_router.ThemeProvider, { value: navigationTheme, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_expo_router.Stack, { screenOptions: { ...rootBackground, statusBarStyle, ...backdropOptions, ...packOptions }, children: [
|
|
483
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_expo_router.Stack.Screen, { name: "index" }),
|
|
484
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_expo_router.Stack.Screen, { name: "play/[game]", options: playOptions })
|
|
475
485
|
] }) });
|
|
476
486
|
if (!Backdrop) return stack;
|
|
477
|
-
return /* @__PURE__ */ (0,
|
|
478
|
-
/* @__PURE__ */ (0,
|
|
487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native3.View, { style: styles.root, children: [
|
|
488
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Backdrop, {}),
|
|
479
489
|
stack
|
|
480
490
|
] });
|
|
481
491
|
}
|
|
482
492
|
function GatedApp({ children }) {
|
|
483
493
|
const { loaded } = useProfiles();
|
|
484
|
-
return /* @__PURE__ */ (0,
|
|
494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SplashGate, { gate: "profiles", ready: loaded, children });
|
|
485
495
|
}
|
|
486
496
|
function HapticGatedToastProvider({ children }) {
|
|
487
497
|
const { settings } = (0, import_feedback_press2.useHapticSettings)();
|
|
488
498
|
const { Toaster: PackToasterComponent } = usePack();
|
|
489
|
-
return /* @__PURE__ */ (0,
|
|
499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_toaster2.ToastProvider, { haptics: settings.vibrate ? Haptics : void 0, paper: PackToasterComponent ? void 0 : RNPaper2, children });
|
|
490
500
|
}
|
|
491
501
|
function RotatingToaster() {
|
|
492
502
|
const renderFrame = (0, import_react8.useCallback)(
|
|
493
|
-
(toasts) => /* @__PURE__ */ (0,
|
|
503
|
+
(toasts) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_chrome2.RotatedFrame, { rotatedSafeArea: true, passThrough: true, children: toasts }),
|
|
494
504
|
[]
|
|
495
505
|
);
|
|
496
|
-
return /* @__PURE__ */ (0,
|
|
506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_toaster2.Toaster, { historyButton: null, clearButton: null, limit: 3, renderFrame });
|
|
497
507
|
}
|
|
498
508
|
function PackToaster({ Toaster: PackToasterComponent }) {
|
|
499
|
-
return /* @__PURE__ */ (0,
|
|
509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native3.View, { style: import_react_native3.StyleSheet.absoluteFill, pointerEvents: "box-none", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_chrome2.RotatedFrame, { rotatedSafeArea: true, passThrough: true, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PackToasterComponent, {}) }) });
|
|
500
510
|
}
|
|
501
511
|
function GameProviders({ games, children }) {
|
|
502
|
-
return games.reduceRight((inner, game) => game.Provider ? /* @__PURE__ */ (0,
|
|
512
|
+
return games.reduceRight((inner, game) => game.Provider ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(game.Provider, { children: inner }, game.id) : inner, children);
|
|
503
513
|
}
|
|
504
514
|
function PreviewColors({ previewColor, children }) {
|
|
505
515
|
const { dark } = (0, import_auto_paper2.useAutoPaperTheme)();
|
|
506
516
|
const preview = (0, import_react8.useCallback)((hex) => previewColor(hex, dark), [previewColor, dark]);
|
|
507
|
-
return /* @__PURE__ */ (0,
|
|
517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_profile3.ProfileColorProvider, { preview, children });
|
|
508
518
|
}
|
|
509
519
|
function PackRoot({ pack, children }) {
|
|
510
520
|
const { Provider, previewColor } = pack;
|
|
511
|
-
const inner = Provider ? /* @__PURE__ */ (0,
|
|
512
|
-
return previewColor ? /* @__PURE__ */ (0,
|
|
521
|
+
const inner = Provider ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Provider, { children }) : children;
|
|
522
|
+
return previewColor ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PreviewColors, { previewColor, children: inner }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: inner });
|
|
513
523
|
}
|
|
514
524
|
function RootLayout({ pack, store, persistor }) {
|
|
515
|
-
return /* @__PURE__ */ (0,
|
|
516
|
-
/* @__PURE__ */ (0,
|
|
517
|
-
pack.Toaster ? /* @__PURE__ */ (0,
|
|
518
|
-
/* @__PURE__ */ (0,
|
|
519
|
-
] }) }) }) }) }) }) }) }) }) }) }) });
|
|
525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native_gesture_handler.GestureHandlerRootView, { style: styles.root, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native_safe_area_context2.SafeAreaProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WindowControlsInsets, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PackProvider, { pack, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Fonts, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Providers, { store, persistor, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Theme, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ProfilesProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(LastActiveGameProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(GameProviders, { games: pack.games, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PackRoot, { pack, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(GatedApp, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(HapticGatedToastProvider, { children: [
|
|
526
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(GuideHost, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AppStack, {}) }),
|
|
527
|
+
pack.Toaster ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PackToaster, { Toaster: pack.Toaster }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RotatingToaster, {}),
|
|
528
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(UpdateDialog, {})
|
|
529
|
+
] }) }) }) }) }) }) }) }) }) }) }) }) });
|
|
520
530
|
}
|
|
521
|
-
var styles =
|
|
531
|
+
var styles = import_react_native3.StyleSheet.create({
|
|
522
532
|
root: { flex: 1 }
|
|
523
533
|
});
|
|
524
534
|
|
|
525
535
|
// src/screens/GameRoute.tsx
|
|
526
536
|
var import_expo_router5 = require("expo-router");
|
|
527
537
|
var import_react14 = require("react");
|
|
528
|
-
var
|
|
538
|
+
var import_react_native7 = require("react-native");
|
|
529
539
|
|
|
530
540
|
// src/routes.ts
|
|
531
541
|
var playHref = (game) => ({ pathname: "/play/[game]", params: { game } });
|
|
@@ -541,17 +551,17 @@ var import_lobby2 = require("@tastic/hud/lobby");
|
|
|
541
551
|
var import_split_screen = require("@tastic/split-screen");
|
|
542
552
|
var import_expo_router4 = require("expo-router");
|
|
543
553
|
var import_react13 = require("react");
|
|
544
|
-
var
|
|
554
|
+
var import_react_native6 = require("react-native");
|
|
545
555
|
var import_react_native_reanimated2 = __toESM(require("react-native-reanimated"));
|
|
546
|
-
var
|
|
556
|
+
var import_react_native_safe_area_context3 = require("react-native-safe-area-context");
|
|
547
557
|
var import_react_redux9 = require("react-redux");
|
|
548
558
|
|
|
549
559
|
// src/components/OpponentPicker.tsx
|
|
550
560
|
var import_lobby = require("@tastic/hud/lobby");
|
|
551
561
|
var import_profile4 = require("@tastic/profile");
|
|
552
562
|
var import_react9 = require("react");
|
|
553
|
-
var
|
|
554
|
-
var
|
|
563
|
+
var import_react_native4 = require("react-native");
|
|
564
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
555
565
|
var CPU_PREFIX = "cpu:";
|
|
556
566
|
var NOBODY = "nobody";
|
|
557
567
|
var PERSON = "person";
|
|
@@ -586,9 +596,9 @@ function OpponentPicker({ idPrefix, host, choices, seatTwo, onSeatTwoChange, cpu
|
|
|
586
596
|
const size = (0, import_profile4.getOptionPickerContentSize)(options, colorSection);
|
|
587
597
|
const useAlign = usePickerAlign ?? import_lobby.useZoneClampedAlign;
|
|
588
598
|
const align = useAlign(host.openId === pickerId, size.width, size.height);
|
|
589
|
-
return /* @__PURE__ */ (0,
|
|
599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native4.View, { style: [styles2.button, host.openId === pickerId && styles2.buttonOpen], children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_profile4.OptionPicker, { id: pickerId, host, options, value, onChange: handleChange, color: drawn, dark, icon, colorSection, alignOverride: align, triggerStyle }) });
|
|
590
600
|
}
|
|
591
|
-
var styles2 =
|
|
601
|
+
var styles2 = import_react_native4.StyleSheet.create({
|
|
592
602
|
// Its own column, so a row of seat buttons doesn't stretch the pill to the tallest of them.
|
|
593
603
|
button: {
|
|
594
604
|
alignItems: "center"
|
|
@@ -634,7 +644,7 @@ function useAppSettings() {
|
|
|
634
644
|
}
|
|
635
645
|
|
|
636
646
|
// src/components/SettingsDialog.tsx
|
|
637
|
-
var
|
|
647
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
638
648
|
var noSettingsRules = () => null;
|
|
639
649
|
function SettingsDialog({ visible, onDismiss, onShowHowToPlay, children }) {
|
|
640
650
|
const onUpdateError = (0, import_toaster3.useUpdateErrorToast)();
|
|
@@ -642,18 +652,18 @@ function SettingsDialog({ visible, onDismiss, onShowHowToPlay, children }) {
|
|
|
642
652
|
const { otaVersion, SettingsSections, edgeGuard = true, useSettingsRules = noSettingsRules } = usePack();
|
|
643
653
|
const rules = useSettingsRules();
|
|
644
654
|
const edgeGuardProps = edgeGuard ? { deferBottomEdgeGestures: settings.deferBottomEdgeGestures, onDeferBottomEdgeGestures: (value) => setSettings({ deferBottomEdgeGestures: value }) } : {};
|
|
645
|
-
return /* @__PURE__ */ (0,
|
|
655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_chrome3.BaseSettingsDialog, { visible, onDismiss, version: otaVersion, ...edgeGuardProps, onUpdateError, onShowHowToPlay, leading: rules, children: [
|
|
646
656
|
children,
|
|
647
|
-
SettingsSections && /* @__PURE__ */ (0,
|
|
657
|
+
SettingsSections && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SettingsSections, {})
|
|
648
658
|
] });
|
|
649
659
|
}
|
|
650
660
|
|
|
651
661
|
// src/hooks/useAtComputer.ts
|
|
652
662
|
var import_core6 = require("@tastic/core");
|
|
653
|
-
var
|
|
663
|
+
var import_react_native5 = require("react-native");
|
|
654
664
|
function useAtComputer() {
|
|
655
665
|
const touchPrimary = (0, import_core6.useIsTouchPrimaryDevice)();
|
|
656
|
-
return
|
|
666
|
+
return import_react_native5.Platform.OS === "web" && !touchPrimary;
|
|
657
667
|
}
|
|
658
668
|
|
|
659
669
|
// src/hooks/useOpponent.ts
|
|
@@ -809,7 +819,7 @@ var liveplayActions = actions5;
|
|
|
809
819
|
var liveplaySlice_default = reducer5;
|
|
810
820
|
|
|
811
821
|
// src/screens/LoadoutScreen.tsx
|
|
812
|
-
var
|
|
822
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
813
823
|
var PANEL_SWAP_FADE_MS = 180;
|
|
814
824
|
var P1_CONTROL_ID = "p1-control";
|
|
815
825
|
var P2_CONTROL_ID = "p2-control";
|
|
@@ -831,7 +841,7 @@ function LoadoutScreen({ game }) {
|
|
|
831
841
|
const { panelLayout, panelFadeStyle } = (0, import_split_screen.useDualZoneLayout)(panelMode, false, true, false, PANEL_SWAP_FADE_MS);
|
|
832
842
|
const playersRowFade = panelFadeStyle;
|
|
833
843
|
const [settingsOpen, setSettingsOpen] = (0, import_react13.useState)(false);
|
|
834
|
-
const insets = (0,
|
|
844
|
+
const insets = (0, import_react_native_safe_area_context3.useSafeAreaInsets)();
|
|
835
845
|
const { colors: themeColors, dark } = (0, import_auto_paper4.useAutoPaperTheme)();
|
|
836
846
|
const { p1Color, p2Color, handleP1ColorChange, handleP2ColorChange } = useSeatColors(p2IsHuman);
|
|
837
847
|
const dispatch = (0, import_react_redux9.useDispatch)();
|
|
@@ -888,30 +898,30 @@ function LoadoutScreen({ game }) {
|
|
|
888
898
|
onReset: showMetaInSharedBand ? void 0 : loadout.reset
|
|
889
899
|
});
|
|
890
900
|
const optionsPopoverOpen = controlsHost.openId !== null && loadout.optionIds.includes(controlsHost.openId);
|
|
891
|
-
const sharedControls = showMetaInSharedBand ? /* @__PURE__ */ (0,
|
|
901
|
+
const sharedControls = showMetaInSharedBand ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lobby2.SharedActionBand, { onBack: import_core8.safeBack, onSettings: () => setSettingsOpen(true), onRandomize: loadout.randomize, onReset: loadout.reset, fg, popoverOpen: optionsPopoverOpen, children: optionsRow }) : optionsRow;
|
|
892
902
|
const controlLook = { accentColor: themeColors.tertiary, mutedColor: fgMuted, dark };
|
|
893
903
|
const p1Control = loadout.seatControl(1, controlsHost, { ...controlLook, seatColor: p1Drawn });
|
|
894
|
-
const p1Panel = /* @__PURE__ */ (0,
|
|
895
|
-
const opponentPicker = game.seatTwo && /* @__PURE__ */ (0,
|
|
904
|
+
const p1Panel = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lobby2.PlayerSetupPanel, { idPrefix: "p1", host: controlsHost, color: p1Color, onColorChange: handleP1ColorChange, swatches: import_auto_paper4.defaultColors, takenColor: p2Exists ? p2Color : void 0, allowSwapTaken: mode === "vsCpu", colorCaption: pack.colorCaption, isHuman: true, dark, showReadyButton: false, profiles, selectedProfileId: lastSelected[1], takenProfileId: p2IsHuman ? lastSelected[2] : null, guestLabel: pack.guestLabel ?? "P1", nullLabel: pack.nullLabel, onProfileSelect: handleP1ProfileSelect, onManageProfiles: () => import_expo_router4.router.push(PROFILES_HREF), previewValue: seatPreview, triggerStyle, useSeatPickerAlign: seatPickerAlign }, `p1-${layoutKey}`);
|
|
905
|
+
const opponentPicker = game.seatTwo && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(OpponentPicker, { idPrefix: "p1", host: controlsHost, choices: game.seatTwo, seatTwo, onSeatTwoChange: changeSeatTwo, cpuDifficulty: loadout.cpuDifficulty, color: p2Color, onColorChange: handleP2ColorChange, swatches: import_auto_paper4.defaultColors, takenColor: p1Color, allowSwapTaken: mode === "vsCpu", dark, previewValue: seatPreview, triggerStyle, usePickerAlign: seatPickerAlign }, `opponent-${layoutKey}`);
|
|
896
906
|
const toggleP1Ready = () => setReady((r) => ({ ...r, 1: !r[1] }));
|
|
897
|
-
const seatOne = /* @__PURE__ */ (0,
|
|
898
|
-
/* @__PURE__ */ (0,
|
|
899
|
-
/* @__PURE__ */ (0,
|
|
907
|
+
const seatOne = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native6.View, { style: [styles3.seatOne, !p2IsHuman && styles3.seatOneAlone, p1PickerOpen && styles3.raised], children: [
|
|
908
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native6.View, { style: [styles3.seatOneButtons, p1PickerOpen && styles3.raised], children: [
|
|
909
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native_reanimated2.default.View, { style: [styles3.playersRow, p1PickerOpen && styles3.raised, !p2IsHuman && playersRowFade], children: [
|
|
900
910
|
p1Panel,
|
|
901
911
|
opponentPicker
|
|
902
912
|
] }),
|
|
903
|
-
p1Control && /* @__PURE__ */ (0,
|
|
913
|
+
p1Control && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native6.View, { style: [styles3.controlRow, p1ControlOpen && styles3.raised], children: p1Control })
|
|
904
914
|
] }),
|
|
905
|
-
/* @__PURE__ */ (0,
|
|
915
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lobby2.ReadyButton, { color: p1Drawn, ready: ready[1], onToggleReady: toggleP1Ready, surfaceColor: readySurface, dark, style: !p2IsHuman && p1PickerOpen && styles3.readyButtonHidden })
|
|
906
916
|
] });
|
|
907
917
|
const p2Control = p2IsHuman ? loadout.seatControl(2, p2Host, { ...controlLook, seatColor: p2Drawn }) : void 0;
|
|
908
|
-
const p2Panel = p2IsHuman && /* @__PURE__ */ (0,
|
|
909
|
-
return /* @__PURE__ */ (0,
|
|
910
|
-
/* @__PURE__ */ (0,
|
|
911
|
-
/* @__PURE__ */ (0,
|
|
912
|
-
p2ZoneStyle && /* @__PURE__ */ (0,
|
|
913
|
-
!showMetaInSharedBand && /* @__PURE__ */ (0,
|
|
914
|
-
p2IsHuman ? /* @__PURE__ */ (0,
|
|
918
|
+
const p2Panel = p2IsHuman && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lobby2.PlayerSetupPanel, { idPrefix: "p2", host: p2Host, color: p2Color, onColorChange: handleP2ColorChange, swatches: import_auto_paper4.defaultColors, takenColor: p1Color, colorCaption: pack.colorCaption, isHuman: true, ready: ready[2], onToggleReady: () => setReady((r) => ({ ...r, 2: !r[2] })), dark, secondPicker: p2Control, secondPickerId: p2Control ? P2_CONTROL_ID : void 0, profiles, selectedProfileId: lastSelected[2], takenProfileId: lastSelected[1], guestLabel: pack.guestLabel ?? "P2", nullLabel: pack.nullLabel, onProfileSelect: handleP2ProfileSelect, previewValue: seatPreview, triggerStyle, readySurfaceColor: readySurface }, "p2-zones");
|
|
919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native6.View, { style: [styles3.container, { backgroundColor: bg }], children: [
|
|
920
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native6.View, { style: styles3.frame, children: [
|
|
921
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_chrome4.PressAwayOverlay, { active: controlsHost.openId !== null, onPress: controlsHost.close }),
|
|
922
|
+
p2ZoneStyle && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_chrome4.PressAwayOverlay, { active: controlsHost.openId !== null || p2Host.openId !== null, onPress: p2Host.close, style: p2ZoneStyle }),
|
|
923
|
+
!showMetaInSharedBand && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_chrome4.CornerActionButtons, { onBack: import_core8.safeBack, onSettings: () => setSettingsOpen(true), fg, insets }),
|
|
924
|
+
p2IsHuman ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
915
925
|
import_split_screen.DualZoneLayout,
|
|
916
926
|
{
|
|
917
927
|
panelLayout,
|
|
@@ -923,19 +933,19 @@ function LoadoutScreen({ game }) {
|
|
|
923
933
|
p2Elevated: p2Host.openId !== null,
|
|
924
934
|
sharedElevated: optionsPopoverOpen
|
|
925
935
|
}
|
|
926
|
-
) : /* @__PURE__ */ (0,
|
|
936
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native6.View, { style: styles3.stackedZone, children: [
|
|
927
937
|
sharedControls,
|
|
928
938
|
seatOne
|
|
929
939
|
] })
|
|
930
940
|
] }),
|
|
931
|
-
/* @__PURE__ */ (0,
|
|
941
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SettingsDialog, { visible: settingsOpen, onDismiss: () => setSettingsOpen(false), onShowHowToPlay: () => openFor(game.id) })
|
|
932
942
|
] });
|
|
933
943
|
}
|
|
934
944
|
function halfOf(color) {
|
|
935
945
|
const rgb = (0, import_auto_paper4.getRgb)(color);
|
|
936
946
|
return rgb ? `rgba(${rgb.r},${rgb.g},${rgb.b},0.5)` : void 0;
|
|
937
947
|
}
|
|
938
|
-
var styles3 =
|
|
948
|
+
var styles3 = import_react_native6.StyleSheet.create({
|
|
939
949
|
container: {
|
|
940
950
|
flex: 1
|
|
941
951
|
},
|
|
@@ -1009,13 +1019,13 @@ var styles3 = import_react_native5.StyleSheet.create({
|
|
|
1009
1019
|
});
|
|
1010
1020
|
|
|
1011
1021
|
// src/screens/GameRoute.tsx
|
|
1012
|
-
var
|
|
1022
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1013
1023
|
function LoadoutRoute() {
|
|
1014
1024
|
const { game: id } = (0, import_expo_router5.useLocalSearchParams)();
|
|
1015
1025
|
const game = usePackGame(id);
|
|
1016
|
-
if (!game) return /* @__PURE__ */ (0,
|
|
1017
|
-
if (!hasLoadout(game)) return /* @__PURE__ */ (0,
|
|
1018
|
-
return /* @__PURE__ */ (0,
|
|
1026
|
+
if (!game) return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_expo_router5.Redirect, { href: "/" });
|
|
1027
|
+
if (!hasLoadout(game)) return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_expo_router5.Redirect, { href: playHref(game.id) });
|
|
1028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LoadoutScreen, { game }, game.id);
|
|
1019
1029
|
}
|
|
1020
1030
|
function hasLoadout(game) {
|
|
1021
1031
|
return !!game.useLoadout;
|
|
@@ -1024,9 +1034,9 @@ function PlayRoute() {
|
|
|
1024
1034
|
const { game: id } = (0, import_expo_router5.useLocalSearchParams)();
|
|
1025
1035
|
const game = usePackGame(id);
|
|
1026
1036
|
useResumePoint(game?.resumable ? game.id : null);
|
|
1027
|
-
if (!game) return /* @__PURE__ */ (0,
|
|
1037
|
+
if (!game) return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_expo_router5.Redirect, { href: "/" });
|
|
1028
1038
|
const { PlayScreen } = game;
|
|
1029
|
-
return /* @__PURE__ */ (0,
|
|
1039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(PlayScreen, {}, game.id);
|
|
1030
1040
|
}
|
|
1031
1041
|
function useResumePoint(gameId) {
|
|
1032
1042
|
const { setLastActiveGame, clearLastActiveGame } = useLastActiveGame();
|
|
@@ -1034,7 +1044,7 @@ function useResumePoint(gameId) {
|
|
|
1034
1044
|
if (!gameId) return;
|
|
1035
1045
|
setLastActiveGame(gameId);
|
|
1036
1046
|
return () => {
|
|
1037
|
-
if (
|
|
1047
|
+
if (import_react_native7.AppState.currentState === "active") clearLastActiveGame();
|
|
1038
1048
|
};
|
|
1039
1049
|
}, [gameId, setLastActiveGame, clearLastActiveGame]);
|
|
1040
1050
|
}
|
|
@@ -1046,9 +1056,13 @@ var import_chrome5 = require("@tastic/hud/chrome");
|
|
|
1046
1056
|
var import_profile7 = require("@tastic/profile");
|
|
1047
1057
|
var import_expo_router6 = require("expo-router");
|
|
1048
1058
|
var import_react16 = require("react");
|
|
1049
|
-
var
|
|
1059
|
+
var import_react_native9 = require("react-native");
|
|
1050
1060
|
var import_react_native_paper = require("react-native-paper");
|
|
1051
1061
|
|
|
1062
|
+
// src/components/segmentTheme.ts
|
|
1063
|
+
var SEGMENT_THEME = { roundness: 3.8 };
|
|
1064
|
+
var SEGMENT_RADIUS = 5 * SEGMENT_THEME.roundness;
|
|
1065
|
+
|
|
1052
1066
|
// src/hooks/useFrozenWhileHidden.ts
|
|
1053
1067
|
var import_react15 = require("react");
|
|
1054
1068
|
function useFrozenWhileHidden(value, hidden) {
|
|
@@ -1067,8 +1081,8 @@ function useFrozenWhileHidden(value, hidden) {
|
|
|
1067
1081
|
|
|
1068
1082
|
// src/screens/homeLayout.ts
|
|
1069
1083
|
var import_core11 = require("@tastic/core");
|
|
1070
|
-
var
|
|
1071
|
-
var
|
|
1084
|
+
var import_react_native8 = require("react-native");
|
|
1085
|
+
var import_react_native_safe_area_context4 = require("react-native-safe-area-context");
|
|
1072
1086
|
var PREVIEW_ASPECT = 360 / 200;
|
|
1073
1087
|
var ROW_PREVIEW_WIDTH = 92;
|
|
1074
1088
|
var HOME_WIDE_EDGE_PADDING = 16;
|
|
@@ -1121,13 +1135,13 @@ function computeHomeLayout(windowWidth, windowHeight, insets) {
|
|
|
1121
1135
|
};
|
|
1122
1136
|
}
|
|
1123
1137
|
function useHomeLayout() {
|
|
1124
|
-
const { width, height } = (0,
|
|
1125
|
-
const insets = (0,
|
|
1138
|
+
const { width, height } = (0, import_react_native8.useWindowDimensions)();
|
|
1139
|
+
const insets = (0, import_react_native_safe_area_context4.useSafeAreaInsets)();
|
|
1126
1140
|
return computeHomeLayout(width, height, insets);
|
|
1127
1141
|
}
|
|
1128
1142
|
|
|
1129
1143
|
// src/screens/HomeScreen.tsx
|
|
1130
|
-
var
|
|
1144
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1131
1145
|
function HomeScreen() {
|
|
1132
1146
|
const pack = usePack();
|
|
1133
1147
|
const { consumeResumeGame } = useLastActiveGame();
|
|
@@ -1139,8 +1153,8 @@ function HomeScreen() {
|
|
|
1139
1153
|
(0, import_react16.useEffect)(() => {
|
|
1140
1154
|
if (!resumeGame) autoShowPack();
|
|
1141
1155
|
}, [resumeGame, autoShowPack]);
|
|
1142
|
-
if (resumeGame) return /* @__PURE__ */ (0,
|
|
1143
|
-
return /* @__PURE__ */ (0,
|
|
1156
|
+
if (resumeGame) return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_expo_router6.Redirect, { href: playHref(resumeGame.id) });
|
|
1157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(HomeMenu, {});
|
|
1144
1158
|
}
|
|
1145
1159
|
function HomeMenu() {
|
|
1146
1160
|
const pack = usePack();
|
|
@@ -1151,9 +1165,9 @@ function HomeMenu() {
|
|
|
1151
1165
|
const [settingsOpen, setSettingsOpen] = (0, import_react16.useState)(false);
|
|
1152
1166
|
const [rulesGame, setRulesGame] = (0, import_react16.useState)(null);
|
|
1153
1167
|
const isFocused = (0, import_expo_router6.useIsFocused)();
|
|
1154
|
-
const [appState, setAppState] = (0, import_react16.useState)(
|
|
1168
|
+
const [appState, setAppState] = (0, import_react16.useState)(import_react_native9.AppState.currentState);
|
|
1155
1169
|
(0, import_react16.useEffect)(() => {
|
|
1156
|
-
const subscription =
|
|
1170
|
+
const subscription = import_react_native9.AppState.addEventListener("change", setAppState);
|
|
1157
1171
|
return () => subscription.remove();
|
|
1158
1172
|
}, []);
|
|
1159
1173
|
const heroActive = isFocused && appState === "active";
|
|
@@ -1183,7 +1197,7 @@ function HomeMenu() {
|
|
|
1183
1197
|
const [tabLabel, setTabLabel] = (0, import_react16.useState)(() => tabs?.[0].label ?? null);
|
|
1184
1198
|
const tab = tabs ? tabs.find((t) => t.label === tabLabel) ?? tabs[0] : null;
|
|
1185
1199
|
const tabButtons = (0, import_react16.useMemo)(() => tabs?.map(({ label }) => ({ value: label, label })) ?? [], [tabs]);
|
|
1186
|
-
const tabBar = tab && /* @__PURE__ */ (0,
|
|
1200
|
+
const tabBar = tab && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native_paper.SegmentedButtons, { value: tab.label, onValueChange: setTabLabel, buttons: tabButtons, theme: SEGMENT_THEME, style: [styles4.tabs, pack.Backdrop && { backgroundColor: colors.surface }] });
|
|
1187
1201
|
const columnClamp = useClampOnShrink();
|
|
1188
1202
|
const gridClamp = useClampOnShrink();
|
|
1189
1203
|
const openGame = (0, import_react16.useCallback)((game) => openFirstTime(game.id, () => import_expo_router6.router.push(game.useLoadout ? loadoutHref(game.id) : playHref(game.id))), [openFirstTime]);
|
|
@@ -1192,33 +1206,33 @@ function HomeMenu() {
|
|
|
1192
1206
|
const usePickerAlign = pack.usePickerAlign ?? noPickerAlign;
|
|
1193
1207
|
const pickerSize = (0, import_profile7.getProfilePickerContentSize)(profiles.length, true, colorSection);
|
|
1194
1208
|
const pickerAlign = usePickerAlign(pickerHost.openId === `${SEAT_ONE_PICKER}-profile`, pickerSize.width, pickerSize.height);
|
|
1195
|
-
const picker = /* @__PURE__ */ (0,
|
|
1196
|
-
const pressAway = /* @__PURE__ */ (0,
|
|
1209
|
+
const picker = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_profile7.ProfilePicker, { idPrefix: SEAT_ONE_PICKER, host: pickerHost, profiles, selectedId: lastSelected[1], color: p1Drawn, dark, guestLabel: pack.guestLabel ?? "P1", nullLabel: pack.nullLabel, onSelect: (profile) => selectProfile(1, profile?.id ?? null), onManage: () => import_expo_router6.router.push(PROFILES_HREF), colorSection, alignOverride: pickerAlign, triggerStyle });
|
|
1210
|
+
const pressAway = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_chrome5.PressAwayOverlay, { active: pickerHost.openId !== null, onPress: pickerHost.close, style: styles4.pressAway });
|
|
1197
1211
|
const RulesSheet = rulesGame?.Rules;
|
|
1198
|
-
return /* @__PURE__ */ (0,
|
|
1199
|
-
/* @__PURE__ */ (0,
|
|
1200
|
-
isWide ? /* @__PURE__ */ (0,
|
|
1212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native9.View, { style: [styles4.container, { backgroundColor: bg }], children: [
|
|
1213
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native9.View, { style: styles4.frame, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(RulesHost, { enabled: pack.games.some((game) => game.Rules), children: [
|
|
1214
|
+
isWide ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
1201
1215
|
pressAway,
|
|
1202
|
-
/* @__PURE__ */ (0,
|
|
1203
|
-
tabBar && /* @__PURE__ */ (0,
|
|
1204
|
-
/* @__PURE__ */ (0,
|
|
1216
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_auto_paper5.FadingScrollView, { ...tab && gridClamp, style: [styles4.wideRightPane, { left: layout.paddingLeft + layout.leftPaneWidth + HOME_WIDE_PANE_GAP }], contentContainerStyle: { paddingTop: 16 + insets.top, paddingBottom: 16 + insets.bottom, paddingRight: layout.paddingRight }, children: [
|
|
1217
|
+
tabBar && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native9.View, { style: [styles4.wideTabs, { width: layout.rightPaneWidth }], children: tabBar }),
|
|
1218
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native9.View, { style: [styles4.grid, { width: layout.rightPaneWidth }], children: pack.games.map((game) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GameTile, { game, hidden: isHidden(tab, game), width: layout.tileWidth, previewWidth: layout.previewWidth, previewRevealed: previewsRevealed, dark, p1Color, p2Color, onPress: () => openGame(game), onRules: hasRules(game) ? () => openRules(game) : void 0 }, game.id)) })
|
|
1205
1219
|
] }),
|
|
1206
|
-
/* @__PURE__ */ (0,
|
|
1207
|
-
/* @__PURE__ */ (0,
|
|
1208
|
-
/* @__PURE__ */ (0,
|
|
1220
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native9.View, { style: [styles4.wideLeftPane, { left: layout.paddingLeft, width: layout.leftPaneWidth, paddingTop: HOME_TOP_BAND + insets.top, paddingBottom: 16 + insets.bottom }, pickerHost.openId !== null && styles4.pickerOpen], children: [
|
|
1221
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(pack.HeroTitle, { words: pack.wordmark, color: fg, p1Color, p2Color, active: heroActive, fit: layout.heroFit }),
|
|
1222
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native9.View, { style: styles4.widePicker, children: picker })
|
|
1209
1223
|
] })
|
|
1210
|
-
] }) : /* @__PURE__ */ (0,
|
|
1224
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_auto_paper5.FadingScrollView, { ...tab && columnClamp, style: styles4.scroll, contentContainerStyle: [styles4.content, { paddingTop: 56 + insets.top, paddingBottom: 24 + insets.bottom, paddingLeft: 16 + insets.left, paddingRight: 16 + insets.right }], children: [
|
|
1211
1225
|
pressAway,
|
|
1212
|
-
/* @__PURE__ */ (0,
|
|
1213
|
-
/* @__PURE__ */ (0,
|
|
1214
|
-
tabBar && /* @__PURE__ */ (0,
|
|
1215
|
-
/* @__PURE__ */ (0,
|
|
1226
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(pack.HeroTitle, { words: pack.wordmark, color: fg, p1Color, p2Color, active: heroActive }),
|
|
1227
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native9.View, { style: [styles4.picker, pickerHost.openId !== null && styles4.pickerOpen], children: picker }),
|
|
1228
|
+
tabBar && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native9.View, { style: styles4.listWidth, children: tabBar }),
|
|
1229
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native9.View, { style: styles4.list, children: pack.games.map((game) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GameRow, { game, hidden: isHidden(tab, game), dark, p1Color, p2Color, previewRevealed: previewsRevealed, onPress: () => openGame(game), onRules: hasRules(game) ? () => openRules(game) : void 0 }, game.id)) })
|
|
1216
1230
|
] }),
|
|
1217
|
-
/* @__PURE__ */ (0,
|
|
1218
|
-
/* @__PURE__ */ (0,
|
|
1219
|
-
RulesSheet && /* @__PURE__ */ (0,
|
|
1231
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_feedback_press3.IconButton, { icon: "trophy", iconColor: fg, size: 24, style: [styles4.corner, { top: 8 + insets.top, left: 8 + insets.left }], onPress: () => import_expo_router6.router.push(STATS_HREF), accessibilityLabel: "Stats & Achievements" }),
|
|
1232
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_feedback_press3.IconButton, { icon: "cog", iconColor: fg, size: 24, style: [styles4.corner, { top: 8 + insets.top, right: 8 + insets.right }], onPress: () => setSettingsOpen(true), accessibilityLabel: "Settings" }),
|
|
1233
|
+
RulesSheet && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(RulesSheet, { visible: true, onDismiss: () => setRulesGame(null) })
|
|
1220
1234
|
] }) }),
|
|
1221
|
-
/* @__PURE__ */ (0,
|
|
1235
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SettingsDialog, { visible: settingsOpen, onDismiss: () => setSettingsOpen(false), onShowHowToPlay: pack.guide ? openPack : void 0 })
|
|
1222
1236
|
] });
|
|
1223
1237
|
}
|
|
1224
1238
|
var SEAT_ONE_PICKER = "home-p1";
|
|
@@ -1255,7 +1269,7 @@ function hasRules(game) {
|
|
|
1255
1269
|
return !!(game.Rules || game.guide);
|
|
1256
1270
|
}
|
|
1257
1271
|
function RulesHost({ enabled, children }) {
|
|
1258
|
-
return enabled ? /* @__PURE__ */ (0,
|
|
1272
|
+
return enabled ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native_paper.Portal.Host, { children }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children });
|
|
1259
1273
|
}
|
|
1260
1274
|
var ROW_BLURB_LINES = 3;
|
|
1261
1275
|
function GameRow({ game, hidden, dark, p1Color, p2Color, previewRevealed, onPress, onRules }) {
|
|
@@ -1264,40 +1278,40 @@ function GameRow({ game, hidden, dark, p1Color, p2Color, previewRevealed, onPres
|
|
|
1264
1278
|
return (
|
|
1265
1279
|
// The rules button sits beside the row's own button, laid over its end, not inside it: a button
|
|
1266
1280
|
// inside a button is invalid on the web.
|
|
1267
|
-
/* @__PURE__ */ (0,
|
|
1268
|
-
/* @__PURE__ */ (0,
|
|
1269
|
-
game.Preview ? /* @__PURE__ */ (0,
|
|
1270
|
-
/* @__PURE__ */ (0,
|
|
1271
|
-
/* @__PURE__ */ (0,
|
|
1272
|
-
/* @__PURE__ */ (0,
|
|
1281
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native9.View, { style: hidden ? styles4.hidden : void 0, children: [
|
|
1282
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_feedback_press3.Pressable, { onPress, style: [styles4.row, { backgroundColor: well.bg }], accessibilityRole: "button", accessibilityLabel: game.title, children: [
|
|
1283
|
+
game.Preview ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PreviewBox, { game, width: ROW_PREVIEW_WIDTH, revealed: previewRevealed, dark, p1Color, p2Color }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native9.View, { style: [styles4.rowIcon, { backgroundColor: dark ? ICON_DARK_BG : ICON_LIGHT_BG }], children: GameIcon && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GameIcon, { size: ROW_ICON_SIZE, p1Color, p2Color, dark }) }),
|
|
1284
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native9.View, { style: styles4.rowText, children: [
|
|
1285
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native_paper.Text, { variant: "titleLarge", style: [styles4.rowTitle, { color: well.fg }], numberOfLines: 1, children: game.title }),
|
|
1286
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native_paper.Text, { variant: "bodyMedium", style: { color: well.fgMuted }, numberOfLines: ROW_BLURB_LINES, children: game.blurb })
|
|
1273
1287
|
] })
|
|
1274
1288
|
] }),
|
|
1275
|
-
onRules && /* @__PURE__ */ (0,
|
|
1289
|
+
onRules && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_feedback_press3.Pressable, { onPress: onRules, style: styles4.rulesButton, hitSlop: 12, accessibilityRole: "button", accessibilityLabel: `${game.title} rules`, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native_paper.Icon, { source: "information-outline", size: 22, color: well.fgMuted }) })
|
|
1276
1290
|
] })
|
|
1277
1291
|
);
|
|
1278
1292
|
}
|
|
1279
1293
|
function GameTile({ game, hidden, width, previewWidth, dark, p1Color, p2Color, previewRevealed, onPress, onRules }) {
|
|
1280
1294
|
const well = (0, import_chrome5.useWellColors)();
|
|
1281
|
-
return /* @__PURE__ */ (0,
|
|
1282
|
-
/* @__PURE__ */ (0,
|
|
1283
|
-
/* @__PURE__ */ (0,
|
|
1284
|
-
/* @__PURE__ */ (0,
|
|
1285
|
-
/* @__PURE__ */ (0,
|
|
1295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native9.View, { style: [{ width }, hidden && styles4.hidden], children: [
|
|
1296
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_feedback_press3.Pressable, { onPress, style: [styles4.tile, { backgroundColor: well.bg }], accessibilityRole: "button", accessibilityLabel: game.title, children: [
|
|
1297
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PreviewBox, { game, width: previewWidth, revealed: previewRevealed, dark, p1Color, p2Color }),
|
|
1298
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native_paper.Text, { variant: "titleMedium", style: [styles4.rowTitle, { color: well.fg }], numberOfLines: 1, children: game.title }),
|
|
1299
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native_paper.Text, { variant: "bodySmall", style: { color: well.fgMuted }, numberOfLines: 3, children: game.blurb })
|
|
1286
1300
|
] }),
|
|
1287
|
-
onRules && /* @__PURE__ */ (0,
|
|
1301
|
+
onRules && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_feedback_press3.Pressable, { onPress: onRules, style: styles4.tileRulesButton, hitSlop: 12, accessibilityRole: "button", accessibilityLabel: `${game.title} rules`, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native_paper.Icon, { source: "information-outline", size: 20, color: "#FFFFFF" }) })
|
|
1288
1302
|
] });
|
|
1289
1303
|
}
|
|
1290
1304
|
function PreviewBox({ game, width, revealed, dark, p1Color, p2Color }) {
|
|
1291
1305
|
const height = Math.round(width / PREVIEW_ASPECT);
|
|
1292
1306
|
const { Preview, icon: GameIcon } = game;
|
|
1293
1307
|
const iconSize = Math.min(height, ROW_ICON_SIZE);
|
|
1294
|
-
return /* @__PURE__ */ (0,
|
|
1308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native9.View, { style: [styles4.preview, { width, height, backgroundColor: dark ? ICON_DARK_BG : ICON_LIGHT_BG }], children: Preview ? revealed && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Preview, { width, height, p1Color, p2Color, dark }) : GameIcon && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native9.View, { style: [styles4.previewIcon, { width: iconSize, height: iconSize, borderRadius: iconSize * 0.22 }], children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GameIcon, { size: iconSize, p1Color, p2Color, dark }) }) });
|
|
1295
1309
|
}
|
|
1296
1310
|
var ROW_ICON_SIZE = 56;
|
|
1297
1311
|
var ICON_LIGHT_BG = "#FAFAFA";
|
|
1298
1312
|
var ICON_DARK_BG = "#050505";
|
|
1299
1313
|
var RULES_BUTTON_SPACE = 44;
|
|
1300
|
-
var styles4 =
|
|
1314
|
+
var styles4 = import_react_native9.StyleSheet.create({
|
|
1301
1315
|
container: {
|
|
1302
1316
|
flex: 1
|
|
1303
1317
|
},
|
|
@@ -1391,9 +1405,9 @@ var styles4 = import_react_native8.StyleSheet.create({
|
|
|
1391
1405
|
scroll: {
|
|
1392
1406
|
flex: 1
|
|
1393
1407
|
},
|
|
1394
|
-
// SegmentedButtons' own rounding, so a surface behind it is the same pill (the stats screen's tabs).
|
|
1408
|
+
// SegmentedButtons' own rounding (SEGMENT_THEME's), so a surface behind it is the same pill (the stats screen's tabs).
|
|
1395
1409
|
tabs: {
|
|
1396
|
-
borderRadius:
|
|
1410
|
+
borderRadius: SEGMENT_RADIUS
|
|
1397
1411
|
},
|
|
1398
1412
|
// The same well as a row, turned on its side.
|
|
1399
1413
|
tile: {
|
|
@@ -1444,7 +1458,7 @@ var styles4 = import_react_native8.StyleSheet.create({
|
|
|
1444
1458
|
var import_auto_paper6 = require("@rific/auto-paper");
|
|
1445
1459
|
var import_chrome6 = require("@tastic/hud/chrome");
|
|
1446
1460
|
var import_profile8 = require("@tastic/profile");
|
|
1447
|
-
var
|
|
1461
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1448
1462
|
var ROSTER_MAX_WIDTH = 640;
|
|
1449
1463
|
function useRosterAlign(open, contentWidth, contentHeight) {
|
|
1450
1464
|
const { usePickerAlign } = usePack();
|
|
@@ -1453,7 +1467,7 @@ function useRosterAlign(open, contentWidth, contentHeight) {
|
|
|
1453
1467
|
function ProfilesRoute() {
|
|
1454
1468
|
const { profiles, createProfile, updateProfile, deleteProfile } = useProfiles();
|
|
1455
1469
|
const { Backdrop, foreground, newProfileColor, usePickerAlign } = usePack();
|
|
1456
|
-
return /* @__PURE__ */ (0,
|
|
1470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_chrome6.RotatedFrame, { rotatedSafeArea: true, portalHost: true, maxContentWidth: ROSTER_MAX_WIDTH, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_profile8.ProfilesScreen, { profiles, defaultColor: newProfileColor ?? import_auto_paper6.defaultColors[0].value, onCreate: (patch) => createProfile(patch), onSave: (id, patch) => updateProfile(id, patch), onDelete: deleteProfile, onBack: import_core8.safeBack, fg: foreground, bg: Backdrop ? "transparent" : void 0, useColorPickerAlign: usePickerAlign ? useRosterAlign : void 0 }) });
|
|
1457
1471
|
}
|
|
1458
1472
|
|
|
1459
1473
|
// src/screens/StatsScreen.tsx
|
|
@@ -1461,18 +1475,18 @@ var import_auto_paper7 = require("@rific/auto-paper");
|
|
|
1461
1475
|
var import_chrome7 = require("@tastic/hud/chrome");
|
|
1462
1476
|
var import_profile9 = require("@tastic/profile");
|
|
1463
1477
|
var import_react17 = require("react");
|
|
1464
|
-
var
|
|
1478
|
+
var import_react_native10 = require("react-native");
|
|
1465
1479
|
var import_react_native_paper2 = require("react-native-paper");
|
|
1466
|
-
var
|
|
1480
|
+
var import_react_native_safe_area_context5 = require("react-native-safe-area-context");
|
|
1467
1481
|
var import_react_redux10 = require("react-redux");
|
|
1468
|
-
var
|
|
1482
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1469
1483
|
var STATS = "stats";
|
|
1470
1484
|
var ACHIEVEMENTS = "achievements";
|
|
1471
1485
|
var TABS = [
|
|
1472
1486
|
{ value: STATS, label: "Stats", icon: "chart-box-outline" },
|
|
1473
1487
|
{ value: ACHIEVEMENTS, label: "Achievements", icon: "trophy-outline" }
|
|
1474
1488
|
];
|
|
1475
|
-
var LABEL_WIDE_TAB = { flexBasis: "auto", flexGrow: 1, flexShrink: 1 };
|
|
1489
|
+
var LABEL_WIDE_TAB = { flex: 0, flexBasis: "auto", flexGrow: 1, flexShrink: 1 };
|
|
1476
1490
|
var NO_PACK_TABS = [];
|
|
1477
1491
|
var EVERYONE = "__everyone__";
|
|
1478
1492
|
var ALL_GAMES = "__all__";
|
|
@@ -1481,17 +1495,17 @@ var GAME_PICKER_ID = "stats-game";
|
|
|
1481
1495
|
var STATS_MAX_WIDTH = 640;
|
|
1482
1496
|
function StatsScreen() {
|
|
1483
1497
|
const pickerHost = (0, import_chrome7.usePopoverHost)();
|
|
1484
|
-
return /* @__PURE__ */ (0,
|
|
1498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(StatsPressAway, { host: pickerHost, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_chrome7.RotatedFrame, { rotatedSafeArea: true, portalHost: true, maxContentWidth: STATS_MAX_WIDTH, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(StatsContent, { pickerHost }) }) });
|
|
1485
1499
|
}
|
|
1486
1500
|
function StatsPressAway({ host, children }) {
|
|
1487
|
-
return /* @__PURE__ */ (0,
|
|
1501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native10.View, { testID: "stats-press-away", style: styles5.screen, onStartShouldSetResponder: () => host.openId !== null, onResponderRelease: host.close, children });
|
|
1488
1502
|
}
|
|
1489
1503
|
var useNoPackReset = () => null;
|
|
1490
1504
|
var noPickerAlign2 = () => void 0;
|
|
1491
1505
|
function StatsContent({ pickerHost }) {
|
|
1492
1506
|
const pack = usePack();
|
|
1493
1507
|
const { dark, colors } = (0, import_auto_paper7.useAutoPaperTheme)();
|
|
1494
|
-
const insets = (0,
|
|
1508
|
+
const insets = (0, import_react_native_safe_area_context5.useSafeAreaInsets)();
|
|
1495
1509
|
const { profiles, lastSelected } = useProfiles();
|
|
1496
1510
|
const dispatch = (0, import_react_redux10.useDispatch)();
|
|
1497
1511
|
const fg = pack.foreground ?? colors.onBackground;
|
|
@@ -1518,16 +1532,16 @@ function StatsContent({ pickerHost }) {
|
|
|
1518
1532
|
const surface = pack.Backdrop ? { backgroundColor: colors.surface } : void 0;
|
|
1519
1533
|
const triggerStyle = pack.Backdrop ? [styles5.pill, surface] : void 0;
|
|
1520
1534
|
const PackTabContent = packTab?.Content;
|
|
1521
|
-
return /* @__PURE__ */ (0,
|
|
1522
|
-
/* @__PURE__ */ (0,
|
|
1523
|
-
/* @__PURE__ */ (0,
|
|
1524
|
-
/* @__PURE__ */ (0,
|
|
1525
|
-
profiles.length > 0 && /* @__PURE__ */ (0,
|
|
1526
|
-
showGamePicker && /* @__PURE__ */ (0,
|
|
1535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_chrome7.BaseStatsScreen, { title, onBack: import_core8.safeBack, insets, onReset: reset.onReset, resetLabel: reset.label, resetConfirmTitle: reset.title, resetConfirmBody: reset.body, fg: pack.foreground, bg: pack.Backdrop ? "transparent" : void 0, rotation: 0, children: [
|
|
1536
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_chrome7.PressAwayOverlay, { active: pickerHost.openId !== null, onPress: pickerHost.close, style: styles5.pressAway }),
|
|
1537
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native_paper2.SegmentedButtons, { value: tab, onValueChange: setTab, buttons: tabButtons, theme: SEGMENT_THEME, style: [styles5.tabs, surface] }),
|
|
1538
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native10.View, { style: [styles5.filters, pickerHost.openId !== null && styles5.filtersOpen], onStartShouldSetResponder: () => pickerHost.openId !== null, children: [
|
|
1539
|
+
profiles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_profile9.OptionPicker, { id: PLAYER_PICKER_ID, host: pickerHost, options: playerOptions, value: profileId ?? EVERYONE, onChange: (value) => setSelectedProfileId(value === EVERYONE ? null : value), color: colors.primary, dark, icon: profileId ? "account" : "account-group", alignOverride: playerAlign, triggerStyle }),
|
|
1540
|
+
showGamePicker && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_profile9.OptionPicker, { id: GAME_PICKER_ID, host: pickerHost, options: gameOptions, value: gameId, onChange: setGameId, color: colors.primary, dark, icon: "view-grid-outline", alignOverride: gameAlign, triggerStyle })
|
|
1527
1541
|
] }),
|
|
1528
|
-
tab === STATS && pack.StatsSections && /* @__PURE__ */ (0,
|
|
1529
|
-
PackTabContent && /* @__PURE__ */ (0,
|
|
1530
|
-
tab === ACHIEVEMENTS && pack.AchievementList ? /* @__PURE__ */ (0,
|
|
1542
|
+
tab === STATS && pack.StatsSections && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(pack.StatsSections, { profileId, gameId: gameId === ALL_GAMES ? null : gameId }),
|
|
1543
|
+
PackTabContent && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PackTabContent, { profileId, gameId: gameId === ALL_GAMES ? null : gameId }),
|
|
1544
|
+
tab === ACHIEVEMENTS && pack.AchievementList ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(pack.AchievementList, { profileId }) : (tab === STATS || tab === ACHIEVEMENTS) && games.map((game) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GameStats, { game, tab, profileId, showTitle: games.length > 1 && pack.statsGameTitles !== false, titleColor: fg }, game.id))
|
|
1531
1545
|
] });
|
|
1532
1546
|
}
|
|
1533
1547
|
function resetFor(pack, packReset, profileId, profiles, games, resetGames) {
|
|
@@ -1542,12 +1556,12 @@ function GameStats({ game, tab, profileId, showTitle, titleColor }) {
|
|
|
1542
1556
|
const { StatsSections, AchievementList } = game;
|
|
1543
1557
|
const Sections = tab === STATS ? StatsSections : AchievementList;
|
|
1544
1558
|
if (!Sections) return null;
|
|
1545
|
-
return /* @__PURE__ */ (0,
|
|
1546
|
-
showTitle && /* @__PURE__ */ (0,
|
|
1547
|
-
/* @__PURE__ */ (0,
|
|
1559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native10.View, { style: styles5.game, children: [
|
|
1560
|
+
showTitle && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native_paper2.Text, { variant: "titleLarge", style: [styles5.gameTitle, { color: titleColor }], children: game.title }),
|
|
1561
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Sections, { profileId })
|
|
1548
1562
|
] });
|
|
1549
1563
|
}
|
|
1550
|
-
var styles5 =
|
|
1564
|
+
var styles5 = import_react_native10.StyleSheet.create({
|
|
1551
1565
|
filters: {
|
|
1552
1566
|
flexDirection: "row",
|
|
1553
1567
|
flexWrap: "wrap",
|
|
@@ -1574,18 +1588,18 @@ var styles5 = import_react_native9.StyleSheet.create({
|
|
|
1574
1588
|
screen: {
|
|
1575
1589
|
flex: 1
|
|
1576
1590
|
},
|
|
1577
|
-
// SegmentedButtons' own rounding, so a surface behind it is the same pill.
|
|
1591
|
+
// SegmentedButtons' own rounding (SEGMENT_THEME's), so a surface behind it is the same pill.
|
|
1578
1592
|
tabs: {
|
|
1579
|
-
borderRadius:
|
|
1593
|
+
borderRadius: SEGMENT_RADIUS
|
|
1580
1594
|
}
|
|
1581
1595
|
});
|
|
1582
1596
|
|
|
1583
1597
|
// src/components/imageGameIcon.tsx
|
|
1584
|
-
var
|
|
1585
|
-
var
|
|
1598
|
+
var import_react_native11 = require("react-native");
|
|
1599
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1586
1600
|
function imageGameIcon(images) {
|
|
1587
1601
|
return function ImageGameIcon({ size, dark }) {
|
|
1588
|
-
return /* @__PURE__ */ (0,
|
|
1602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native11.Image, { source: dark ? images.dark : images.light, style: { height: size, width: size }, accessibilityIgnoresInvertColors: true });
|
|
1589
1603
|
};
|
|
1590
1604
|
}
|
|
1591
1605
|
|
|
@@ -1593,16 +1607,16 @@ function imageGameIcon(images) {
|
|
|
1593
1607
|
var import_auto_paper8 = require("@rific/auto-paper");
|
|
1594
1608
|
var import_feedback_press4 = require("@rific/feedback-press");
|
|
1595
1609
|
var import_react18 = require("react");
|
|
1596
|
-
var
|
|
1610
|
+
var import_react_native12 = require("react-native");
|
|
1597
1611
|
var import_react_native_reanimated3 = __toESM(require("react-native-reanimated"));
|
|
1598
|
-
var
|
|
1599
|
-
var
|
|
1612
|
+
var import_react_native_safe_area_context6 = require("react-native-safe-area-context");
|
|
1613
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1600
1614
|
var MATCH_CHIPS_FADE_MS = 150;
|
|
1601
1615
|
var CHIP_SIZE = 48;
|
|
1602
1616
|
var EDGE_PAD = 8;
|
|
1603
1617
|
function MatchChips({ playing, faceToFace, centerLineY, onBack, onSettings }) {
|
|
1604
|
-
const { height } = (0,
|
|
1605
|
-
const insets = (0,
|
|
1618
|
+
const { height } = (0, import_react_native12.useWindowDimensions)();
|
|
1619
|
+
const insets = (0, import_react_native_safe_area_context6.useSafeAreaInsets)();
|
|
1606
1620
|
const { dark } = (0, import_auto_paper8.useAutoPaperTheme)();
|
|
1607
1621
|
const atComputer = useAtComputer();
|
|
1608
1622
|
const visible = atComputer || !playing;
|
|
@@ -1618,12 +1632,12 @@ function MatchChips({ playing, faceToFace, centerLineY, onBack, onSettings }) {
|
|
|
1618
1632
|
const backSlot = { top, left: EDGE_PAD + insets.left };
|
|
1619
1633
|
const settingsSlot = { top, right: EDGE_PAD + insets.right };
|
|
1620
1634
|
const pointerEvents = visible ? "box-none" : "none";
|
|
1621
|
-
return /* @__PURE__ */ (0,
|
|
1622
|
-
/* @__PURE__ */ (0,
|
|
1623
|
-
/* @__PURE__ */ (0,
|
|
1635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
1636
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native_reanimated3.default.View, { pointerEvents, style: [styles6.slot, backSlot, fadeStyle], testID: "match-chips-back", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_feedback_press4.IconButton, { icon: "arrow-left", iconColor, containerColor, style: styles6.chip, size: 24, onPress: onBack, accessibilityLabel: "Back" }) }),
|
|
1637
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native_reanimated3.default.View, { pointerEvents, style: [styles6.slot, settingsSlot, fadeStyle], testID: "match-chips-settings", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_feedback_press4.IconButton, { icon: "cog", iconColor, containerColor, style: styles6.chip, size: 24, onPress: onSettings, accessibilityLabel: "Settings" }) })
|
|
1624
1638
|
] });
|
|
1625
1639
|
}
|
|
1626
|
-
var styles6 =
|
|
1640
|
+
var styles6 = import_react_native12.StyleSheet.create({
|
|
1627
1641
|
chip: { margin: 0 },
|
|
1628
1642
|
slot: { position: "absolute" }
|
|
1629
1643
|
});
|
|
@@ -1772,7 +1786,7 @@ function forgetProfileAchievements(dropStats) {
|
|
|
1772
1786
|
// src/gameStats.tsx
|
|
1773
1787
|
var import_achievements2 = require("@tastic/achievements");
|
|
1774
1788
|
var import_react19 = require("react");
|
|
1775
|
-
var
|
|
1789
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1776
1790
|
var SEATS = [1, 2];
|
|
1777
1791
|
function createGameStats({ key, defaultStats, isValidStats, catalog, getProfileStatsView }) {
|
|
1778
1792
|
const { actions: actions6, reducer: sliceReducer } = (0, import_achievements2.createAchievementsSlice)({
|
|
@@ -1805,7 +1819,7 @@ function createGameStats({ key, defaultStats, isValidStats, catalog, getProfileS
|
|
|
1805
1819
|
[recordOutcome]
|
|
1806
1820
|
);
|
|
1807
1821
|
const value = (0, import_react19.useMemo)(() => ({ stats, unlockedAchievements, record, resetAll }), [stats, unlockedAchievements, record, resetAll]);
|
|
1808
|
-
return /* @__PURE__ */ (0,
|
|
1822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Context.Provider, { value, children });
|
|
1809
1823
|
}
|
|
1810
1824
|
function useStats() {
|
|
1811
1825
|
const ctx = (0, import_react19.useContext)(Context);
|