@tastic/shell 0.14.0 → 0.16.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/README.md +13 -9
- package/dist/index.d.mts +11 -7
- package/dist/index.d.ts +11 -7
- package/dist/index.js +197 -177
- package/dist/index.mjs +129 -110
- package/package.json +5 -5
- package/src/RootLayout.tsx +1 -1
- package/src/components/SettingsDialog.tsx +13 -2
- package/src/index.ts +1 -0
- package/src/routes.ts +3 -1
- package/src/screens/EditProfileRoute.tsx +31 -0
- package/src/screens/HomeScreen.tsx +1 -1
- package/src/screens/LoadoutScreen.tsx +1 -1
- package/src/screens/ProfilesRoute.tsx +16 -24
- package/src/types.ts +13 -8
package/dist/index.js
CHANGED
|
@@ -32,6 +32,7 @@ var index_exports = {};
|
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
DEFAULT_APP_SETTINGS: () => DEFAULT_APP_SETTINGS,
|
|
34
34
|
DEFAULT_OPPONENT: () => DEFAULT_OPPONENT,
|
|
35
|
+
EditProfileRoute: () => EditProfileRoute,
|
|
35
36
|
GUEST_PLAYER_ID: () => GUEST_PLAYER_ID,
|
|
36
37
|
HomeScreen: () => HomeScreen,
|
|
37
38
|
LoadoutRoute: () => LoadoutRoute,
|
|
@@ -66,7 +67,7 @@ __export(index_exports, {
|
|
|
66
67
|
profileSelectionActions: () => profileSelectionActions,
|
|
67
68
|
profileSelectionReducer: () => profileSelectionSlice_default,
|
|
68
69
|
roundModeFor: () => roundModeFor,
|
|
69
|
-
safeBack: () =>
|
|
70
|
+
safeBack: () => import_core6.safeBack,
|
|
70
71
|
seatColorsActions: () => seatColorsActions,
|
|
71
72
|
seatPlayerKey: () => seatPlayerKey,
|
|
72
73
|
seatTwoFor: () => seatTwoFor,
|
|
@@ -537,7 +538,7 @@ function HapticGatedToastProvider({ children }) {
|
|
|
537
538
|
}
|
|
538
539
|
function FramedToaster() {
|
|
539
540
|
const renderFrame = (0, import_react9.useCallback)((toasts) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_chrome2.ScreenFrame, { passThrough: true, children: toasts }), []);
|
|
540
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_toaster2.Toaster, { historyButton: null, clearButton: null, limit:
|
|
541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_toaster2.Toaster, { historyButton: null, clearButton: null, limit: 1, renderFrame });
|
|
541
542
|
}
|
|
542
543
|
function PackToaster({ Toaster: PackToasterComponent }) {
|
|
543
544
|
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.ScreenFrame, { passThrough: true, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PackToasterComponent, {}) }) });
|
|
@@ -572,24 +573,59 @@ var styles = import_react_native3.StyleSheet.create({
|
|
|
572
573
|
root: { flex: 1 }
|
|
573
574
|
});
|
|
574
575
|
|
|
575
|
-
// src/screens/
|
|
576
|
-
var
|
|
577
|
-
var
|
|
578
|
-
var
|
|
576
|
+
// src/screens/EditProfileRoute.tsx
|
|
577
|
+
var import_auto_paper3 = require("@rific/auto-paper");
|
|
578
|
+
var import_chrome4 = require("@tastic/hud/chrome");
|
|
579
|
+
var import_profile5 = require("@tastic/profile");
|
|
580
|
+
var import_expo_router4 = require("expo-router");
|
|
581
|
+
|
|
582
|
+
// src/navigation.ts
|
|
583
|
+
var import_core6 = require("@rific/core");
|
|
584
|
+
var import_expo_router2 = require("expo-router");
|
|
585
|
+
(0, import_core6.configureNavigation)({ router: import_expo_router2.router });
|
|
586
|
+
|
|
587
|
+
// src/screens/ProfilesRoute.tsx
|
|
588
|
+
var import_chrome3 = require("@tastic/hud/chrome");
|
|
589
|
+
var import_profile4 = require("@tastic/profile");
|
|
590
|
+
var import_expo_router3 = require("expo-router");
|
|
579
591
|
|
|
580
592
|
// src/routes.ts
|
|
581
593
|
var playHref = (game) => ({ pathname: "/play/[game]", params: { game } });
|
|
582
594
|
var loadoutHref = (game) => ({ pathname: "/loadout/[game]", params: { game } });
|
|
583
595
|
var STATS_HREF = "/stats";
|
|
584
596
|
var PROFILES_HREF = "/profiles";
|
|
597
|
+
var profileHref = (id) => ({ pathname: "/profile/[id]", params: { id } });
|
|
598
|
+
|
|
599
|
+
// src/screens/ProfilesRoute.tsx
|
|
600
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
601
|
+
var ROSTER_MAX_WIDTH = 640;
|
|
602
|
+
function ProfilesRoute() {
|
|
603
|
+
const { profiles } = useProfiles();
|
|
604
|
+
const { Backdrop, foreground } = usePack();
|
|
605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_chrome3.ScreenFrame, { maxContentWidth: ROSTER_MAX_WIDTH, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_profile4.ProfilesScreen, { profiles, onEdit: (id) => import_expo_router3.router.push(profileHref(id)), onBack: import_core6.safeBack, fg: foreground, bg: Backdrop ? "transparent" : void 0 }) });
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
// src/screens/EditProfileRoute.tsx
|
|
609
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
610
|
+
function EditProfileRoute() {
|
|
611
|
+
const { id } = (0, import_expo_router4.useLocalSearchParams)();
|
|
612
|
+
const { profiles, createProfile, updateProfile, deleteProfile } = useProfiles();
|
|
613
|
+
const { Backdrop, foreground, newProfileColor, ProfileSections } = usePack();
|
|
614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_chrome4.ScreenFrame, { portalHost: true, maxContentWidth: ROSTER_MAX_WIDTH, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_profile5.EditProfileScreen, { profileId: id, profiles, defaultColor: newProfileColor ?? import_auto_paper3.defaultColors[0].value, onCreate: (patch) => createProfile(patch), onSave: (profileId, patch) => updateProfile(profileId, patch), onDelete: deleteProfile, onBack: import_core6.safeBack, fg: foreground, bg: Backdrop ? "transparent" : void 0, sections: ProfileSections ? (profile) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ProfileSections, { profile }) : void 0 }) });
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
// src/screens/GameRoute.tsx
|
|
618
|
+
var import_expo_router8 = require("expo-router");
|
|
619
|
+
var import_react14 = require("react");
|
|
620
|
+
var import_react_native7 = require("react-native");
|
|
585
621
|
|
|
586
622
|
// src/screens/LoadoutScreen.tsx
|
|
587
|
-
var
|
|
623
|
+
var import_auto_paper5 = require("@rific/auto-paper");
|
|
588
624
|
var import_core10 = require("@tastic/core");
|
|
589
|
-
var
|
|
625
|
+
var import_chrome6 = require("@tastic/hud/chrome");
|
|
590
626
|
var import_lobby2 = require("@tastic/hud/lobby");
|
|
591
627
|
var import_split_screen = require("@tastic/split-screen");
|
|
592
|
-
var
|
|
628
|
+
var import_expo_router7 = require("expo-router");
|
|
593
629
|
var import_react13 = require("react");
|
|
594
630
|
var import_react_native6 = require("react-native");
|
|
595
631
|
var import_react_native_reanimated2 = __toESM(require("react-native-reanimated"));
|
|
@@ -598,10 +634,10 @@ var import_react_redux9 = require("react-redux");
|
|
|
598
634
|
|
|
599
635
|
// src/components/OpponentPicker.tsx
|
|
600
636
|
var import_lobby = require("@tastic/hud/lobby");
|
|
601
|
-
var
|
|
637
|
+
var import_profile6 = require("@tastic/profile");
|
|
602
638
|
var import_react10 = require("react");
|
|
603
639
|
var import_react_native4 = require("react-native");
|
|
604
|
-
var
|
|
640
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
605
641
|
var CPU_PREFIX = "cpu:";
|
|
606
642
|
var NOBODY = "nobody";
|
|
607
643
|
var PERSON = "person";
|
|
@@ -633,10 +669,10 @@ function OpponentPicker({ idPrefix, host, choices, seatTwo, onSeatTwoChange, cpu
|
|
|
633
669
|
};
|
|
634
670
|
const colorSection = seatTwo === "cpu" ? { value: color, onChange: onColorChange, swatches, takenValue: takenColor, allowSwapTaken, previewValue } : void 0;
|
|
635
671
|
const pickerId = getOpponentPopoverId(idPrefix);
|
|
636
|
-
const size = (0,
|
|
672
|
+
const size = (0, import_profile6.getOptionPickerContentSize)(options, colorSection);
|
|
637
673
|
const useAlign = usePickerAlign ?? import_lobby.useZoneClampedAlign;
|
|
638
674
|
const align = useAlign(host.openId === pickerId, size.width, size.height);
|
|
639
|
-
return /* @__PURE__ */ (0,
|
|
675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native4.View, { style: [styles2.button, host.openId === pickerId && styles2.buttonOpen], children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_profile6.OptionPicker, { id: pickerId, host, options, value, onChange: handleChange, color: drawn, dark, icon, colorSection, alignOverride: align, triggerStyle }) });
|
|
640
676
|
}
|
|
641
677
|
var styles2 = import_react_native4.StyleSheet.create({
|
|
642
678
|
// Its own column, so a row of seat buttons doesn't stretch the pill to the tallest of them.
|
|
@@ -651,26 +687,30 @@ var styles2 = import_react_native4.StyleSheet.create({
|
|
|
651
687
|
|
|
652
688
|
// src/components/SettingsDialog.tsx
|
|
653
689
|
var import_toaster3 = require("@rific/toaster");
|
|
654
|
-
var
|
|
655
|
-
var
|
|
690
|
+
var import_chrome5 = require("@tastic/hud/chrome");
|
|
691
|
+
var import_expo_router5 = require("expo-router");
|
|
692
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
656
693
|
var noSettingsRules = () => null;
|
|
657
|
-
function SettingsDialog({ visible, onDismiss, onShowHowToPlay, children }) {
|
|
694
|
+
function SettingsDialog({ visible, onDismiss, onShowHowToPlay, showProfile = false, children }) {
|
|
658
695
|
const onUpdateError = (0, import_toaster3.useUpdateErrorToast)();
|
|
659
696
|
const { settings, setSettings } = useAppSettings();
|
|
660
697
|
const { otaVersion, SettingsSections, edgeGuard = true, useSettingsRules = noSettingsRules } = usePack();
|
|
661
698
|
const rules = useSettingsRules();
|
|
699
|
+
const { profiles, lastSelected } = useProfiles();
|
|
700
|
+
const seatOne = profiles.find((profile) => profile.id === lastSelected[1]) ?? null;
|
|
701
|
+
const profileRow = showProfile ? seatOne ? { onShowProfiles: () => import_expo_router5.router.push(profileHref(seatOne.id)), profilesRow: { label: "Profile", caption: seatOne.name, icon: "account-outline" } } : { onShowProfiles: () => import_expo_router5.router.push(PROFILES_HREF) } : {};
|
|
662
702
|
const edgeGuardProps = edgeGuard ? { deferBottomEdgeGestures: settings.deferBottomEdgeGestures, onDeferBottomEdgeGestures: (value) => setSettings({ deferBottomEdgeGestures: value }) } : {};
|
|
663
|
-
return /* @__PURE__ */ (0,
|
|
703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_chrome5.BaseSettingsDialog, { visible, onDismiss, version: otaVersion, ...edgeGuardProps, onUpdateError, onShowHowToPlay, ...profileRow, leading: rules, children: [
|
|
664
704
|
children,
|
|
665
|
-
SettingsSections && /* @__PURE__ */ (0,
|
|
705
|
+
SettingsSections && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SettingsSections, {})
|
|
666
706
|
] });
|
|
667
707
|
}
|
|
668
708
|
|
|
669
709
|
// src/hooks/useAtComputer.ts
|
|
670
|
-
var
|
|
710
|
+
var import_core7 = require("@tastic/core");
|
|
671
711
|
var import_react_native5 = require("react-native");
|
|
672
712
|
function useAtComputer() {
|
|
673
|
-
const touchPrimary = (0,
|
|
713
|
+
const touchPrimary = (0, import_core7.useIsTouchPrimaryDevice)();
|
|
674
714
|
return import_react_native5.Platform.OS === "web" && !touchPrimary;
|
|
675
715
|
}
|
|
676
716
|
|
|
@@ -679,9 +719,9 @@ var import_react11 = require("react");
|
|
|
679
719
|
var import_react_redux7 = require("react-redux");
|
|
680
720
|
|
|
681
721
|
// src/redux/opponentSlice.ts
|
|
682
|
-
var
|
|
722
|
+
var import_core8 = require("@rific/core");
|
|
683
723
|
var DEFAULT_OPPONENT = { seatTwo: "cpu" };
|
|
684
|
-
var { actions: actions4, reducer: reducer4 } = (0,
|
|
724
|
+
var { actions: actions4, reducer: reducer4 } = (0, import_core8.createSettingsSlice)("opponent", {
|
|
685
725
|
initialState: DEFAULT_OPPONENT
|
|
686
726
|
});
|
|
687
727
|
var opponentActions = actions4;
|
|
@@ -696,21 +736,21 @@ function useOpponent() {
|
|
|
696
736
|
}
|
|
697
737
|
|
|
698
738
|
// src/hooks/useSeatColors.ts
|
|
699
|
-
var
|
|
700
|
-
var
|
|
701
|
-
var
|
|
739
|
+
var import_auto_paper4 = require("@rific/auto-paper");
|
|
740
|
+
var import_profile8 = require("@tastic/profile");
|
|
741
|
+
var import_expo_router6 = require("expo-router");
|
|
702
742
|
var import_react12 = require("react");
|
|
703
743
|
var import_react_redux8 = require("react-redux");
|
|
704
744
|
|
|
705
745
|
// src/redux/seatColorsSlice.ts
|
|
706
|
-
var
|
|
746
|
+
var import_profile7 = require("@tastic/profile");
|
|
707
747
|
function defaultSeatColorsState(seatColors) {
|
|
708
748
|
return { lastGuestColor: { 1: seatColors[1], 2: seatColors[2] }, lastCpuColor: seatColors[2], profileColors: {} };
|
|
709
749
|
}
|
|
710
750
|
function createSeatColorsReducer(seatColors) {
|
|
711
|
-
return (0,
|
|
751
|
+
return (0, import_profile7.createSeatColorsSlice)("pack", defaultSeatColorsState(seatColors)).reducer;
|
|
712
752
|
}
|
|
713
|
-
var seatColorsActions = (0,
|
|
753
|
+
var seatColorsActions = (0, import_profile7.createSeatColorsSlice)("pack", defaultSeatColorsState({ 1: "", 2: "" })).actions;
|
|
714
754
|
|
|
715
755
|
// src/hooks/useSeatColors.ts
|
|
716
756
|
function sameTheme(current, next) {
|
|
@@ -720,8 +760,8 @@ function sameTheme(current, next) {
|
|
|
720
760
|
return sameColor && (next.harmony === void 0 || next.harmony === current.harmony);
|
|
721
761
|
}
|
|
722
762
|
function useSeatColors(p2IsHuman) {
|
|
723
|
-
const { dark, colors: themeColors } = (0,
|
|
724
|
-
const { settings: themeSettings, set: setThemeColor } = (0,
|
|
763
|
+
const { dark, colors: themeColors } = (0, import_auto_paper4.useAutoPaperTheme)();
|
|
764
|
+
const { settings: themeSettings, set: setThemeColor } = (0, import_auto_paper4.useThemeSettings)();
|
|
725
765
|
const { profiles, lastSelected } = useProfiles();
|
|
726
766
|
const { seatColors, seatTheme } = usePack();
|
|
727
767
|
const seatDefaultColors = [seatColors[1], seatColors[2]];
|
|
@@ -732,14 +772,14 @@ function useSeatColors(p2IsHuman) {
|
|
|
732
772
|
const p1Profile = profiles.find((p) => p.id === lastSelected[1]) ?? null;
|
|
733
773
|
const p2Profile = p2IsHuman ? profiles.find((p) => p.id === lastSelected[2]) ?? null : null;
|
|
734
774
|
const rememberedColors = (p1Prof, p2Prof, picks, guest, cpu) => {
|
|
735
|
-
const p1 = p1Prof ? (0,
|
|
736
|
-
const p2 = (0,
|
|
775
|
+
const p1 = p1Prof ? (0, import_profile8.profileSeatColor)(p1Prof, picks) : guest[1];
|
|
776
|
+
const p2 = (0, import_profile8.avoidSeatColorClash)(p1, p2Prof ? (0, import_profile8.profileSeatColor)(p2Prof, picks) : p2IsHuman ? guest[2] : cpu, seatDefaultColors);
|
|
737
777
|
return { p1, p2 };
|
|
738
778
|
};
|
|
739
779
|
const remembered = rememberedColors(p1Profile, p2Profile, profileColors, guestColors, cpuColor);
|
|
740
780
|
const p1Color = seatTheme ? remembered.p1 : themeColors.primary;
|
|
741
781
|
const p2Color = seatTheme ? remembered.p2 : themeColors.secondary;
|
|
742
|
-
const themeFor = (0, import_react12.useCallback)((p1, p2) => seatTheme ? seatTheme({ 1: p1, 2: p2 }, dark) : { color: { primary: p1, secondary: p2, tertiary: (0,
|
|
782
|
+
const themeFor = (0, import_react12.useCallback)((p1, p2) => seatTheme ? seatTheme({ 1: p1, 2: p2 }, dark) : { color: { primary: p1, secondary: p2, tertiary: (0, import_auto_paper4.getThirdColor)(p1, p2) } }, [seatTheme, dark]);
|
|
743
783
|
const p1ProfileRef = (0, import_react12.useRef)(p1Profile);
|
|
744
784
|
const p2ProfileRef = (0, import_react12.useRef)(p2Profile);
|
|
745
785
|
const guestColorsRef = (0, import_react12.useRef)(guestColors);
|
|
@@ -769,7 +809,7 @@ function useSeatColors(p2IsHuman) {
|
|
|
769
809
|
if (sameTheme(themeSettings, next)) return;
|
|
770
810
|
setThemeColor(next);
|
|
771
811
|
}, [lastSelected[1], lastSelected[2], p2IsHuman, guestColors, cpuColor, profileColors, profiles.length, dark]);
|
|
772
|
-
(0,
|
|
812
|
+
(0, import_expo_router6.useFocusEffect)(
|
|
773
813
|
(0, import_react12.useCallback)(() => {
|
|
774
814
|
const next = rememberedColors(p1ProfileRef.current, p2ProfileRef.current, profileColorsRef.current, guestColorsRef.current, cpuColorRef.current);
|
|
775
815
|
setThemeColor(themeForRef.current(next.p1, next.p2));
|
|
@@ -813,11 +853,6 @@ function useSeatColors(p2IsHuman) {
|
|
|
813
853
|
return { p1Color, p2Color, handleP1ColorChange, handleP2ColorChange };
|
|
814
854
|
}
|
|
815
855
|
|
|
816
|
-
// src/navigation.ts
|
|
817
|
-
var import_core8 = require("@rific/core");
|
|
818
|
-
var import_expo_router3 = require("expo-router");
|
|
819
|
-
(0, import_core8.configureNavigation)({ router: import_expo_router3.router });
|
|
820
|
-
|
|
821
856
|
// src/redux/liveplaySlice.ts
|
|
822
857
|
var import_core9 = require("@rific/core");
|
|
823
858
|
var { actions: actions5, reducer: reducer5 } = (0, import_core9.createSettingsSlice)("liveplay", {
|
|
@@ -827,7 +862,7 @@ var liveplayActions = actions5;
|
|
|
827
862
|
var liveplaySlice_default = reducer5;
|
|
828
863
|
|
|
829
864
|
// src/screens/LoadoutScreen.tsx
|
|
830
|
-
var
|
|
865
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
831
866
|
var PANEL_SWAP_FADE_MS = 180;
|
|
832
867
|
var P1_CONTROL_ID = "p1-control";
|
|
833
868
|
var P2_CONTROL_ID = "p2-control";
|
|
@@ -850,13 +885,13 @@ function LoadoutScreen({ game }) {
|
|
|
850
885
|
const playersRowFade = panelFadeStyle;
|
|
851
886
|
const [settingsOpen, setSettingsOpen] = (0, import_react13.useState)(false);
|
|
852
887
|
const insets = (0, import_react_native_safe_area_context3.useSafeAreaInsets)();
|
|
853
|
-
const { colors: themeColors, dark } = (0,
|
|
888
|
+
const { colors: themeColors, dark } = (0, import_auto_paper5.useAutoPaperTheme)();
|
|
854
889
|
const { p1Color, p2Color, handleP1ColorChange, handleP2ColorChange } = useSeatColors(p2IsHuman);
|
|
855
890
|
const dispatch = (0, import_react_redux9.useDispatch)();
|
|
856
891
|
const handleP1ProfileSelect = (0, import_react13.useCallback)((profile) => selectProfile(1, profile?.id ?? null), [selectProfile]);
|
|
857
892
|
const handleP2ProfileSelect = (0, import_react13.useCallback)((profile) => selectProfile(2, profile?.id ?? null), [selectProfile]);
|
|
858
893
|
const [ready, setReady] = (0, import_react13.useState)({ 1: false, 2: false });
|
|
859
|
-
(0,
|
|
894
|
+
(0, import_expo_router7.useFocusEffect)(
|
|
860
895
|
(0, import_react13.useCallback)(() => {
|
|
861
896
|
setReady({ 1: false, 2: false });
|
|
862
897
|
}, [setReady])
|
|
@@ -875,7 +910,7 @@ function LoadoutScreen({ game }) {
|
|
|
875
910
|
(0, import_react13.useEffect)(() => {
|
|
876
911
|
if (!humanSeats.every((s) => ready[s])) return;
|
|
877
912
|
dispatch(liveplayActions.setActiveRound({ game: game.id, mode, settings: roundSettingsRef.current }));
|
|
878
|
-
|
|
913
|
+
import_expo_router7.router.push(playHref(game.id));
|
|
879
914
|
}, [ready, humanSeats, game.id, mode, dispatch]);
|
|
880
915
|
const bg = pack.Backdrop ? "transparent" : dark ? "#000000" : "#FFFFFF";
|
|
881
916
|
const fg = pack.foreground ?? (dark ? "#FFFFFF" : "#000000");
|
|
@@ -891,26 +926,26 @@ function LoadoutScreen({ game }) {
|
|
|
891
926
|
const p2ZoneStyle = p2IsHuman ? isPortrait ? styles3.p2ZoneTop : styles3.p2ZoneRight : null;
|
|
892
927
|
const seatPickerAlign = p2IsHuman ? void 0 : pack.usePickerAlign;
|
|
893
928
|
const layoutKey = p2IsHuman ? "zones" : "row";
|
|
894
|
-
const controlsHost = (0,
|
|
895
|
-
const p2Host = (0,
|
|
929
|
+
const controlsHost = (0, import_chrome6.usePopoverHost)();
|
|
930
|
+
const p2Host = (0, import_chrome6.usePopoverHost)();
|
|
896
931
|
const p1PickerOpen = controlsHost.openId?.startsWith("p1-") ?? false;
|
|
897
932
|
const p1ControlOpen = controlsHost.openId === P1_CONTROL_ID;
|
|
898
933
|
const controlLook = { accentColor: themeColors.tertiary, mutedColor: fgMuted, dark };
|
|
899
934
|
const p1Control = loadout.seatControl(1, controlsHost, { ...controlLook, seatColor: p1Drawn });
|
|
900
|
-
const p1Panel = /* @__PURE__ */ (0,
|
|
901
|
-
const opponentPicker = game.seatTwo && /* @__PURE__ */ (0,
|
|
935
|
+
const p1Panel = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lobby2.PlayerSetupPanel, { idPrefix: "p1", host: controlsHost, color: p1Color, onColorChange: handleP1ColorChange, swatches: import_auto_paper5.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_router7.router.push(PROFILES_HREF), previewValue: seatPreview, triggerStyle, useSeatPickerAlign: seatPickerAlign }, `p1-${layoutKey}`);
|
|
936
|
+
const opponentPicker = game.seatTwo && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(OpponentPicker, { idPrefix: "p1", host: controlsHost, choices: game.seatTwo, seatTwo, onSeatTwoChange: changeSeatTwo, cpuDifficulty: loadout.cpuDifficulty, color: p2Color, onColorChange: handleP2ColorChange, swatches: import_auto_paper5.defaultColors, takenColor: p1Color, allowSwapTaken: mode === "vsCpu", dark, previewValue: seatPreview, triggerStyle, usePickerAlign: seatPickerAlign }, `opponent-${layoutKey}`);
|
|
902
937
|
const toggleP1Ready = () => setReady((r) => ({ ...r, 1: !r[1] }));
|
|
903
|
-
const seatButtons = /* @__PURE__ */ (0,
|
|
904
|
-
/* @__PURE__ */ (0,
|
|
938
|
+
const seatButtons = /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native6.View, { style: [styles3.seatOneButtons, p1PickerOpen && styles3.raised], children: [
|
|
939
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native_reanimated2.default.View, { style: [styles3.playersRow, p1PickerOpen && styles3.raised, !p2IsHuman && playersRowFade], children: [
|
|
905
940
|
p1Panel,
|
|
906
941
|
opponentPicker
|
|
907
942
|
] }),
|
|
908
|
-
p1Control && /* @__PURE__ */ (0,
|
|
943
|
+
p1Control && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native6.View, { style: [styles3.controlRow, p1ControlOpen && styles3.raised], children: p1Control })
|
|
909
944
|
] });
|
|
910
945
|
const seatsInOptions = !p2IsHuman && !!loadout.placesSeats;
|
|
911
|
-
const seatOne = /* @__PURE__ */ (0,
|
|
946
|
+
const seatOne = /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native6.View, { style: [styles3.seatOne, !p2IsHuman && styles3.seatOneAlone, p1PickerOpen && !seatsInOptions && styles3.raised], children: [
|
|
912
947
|
!seatsInOptions && seatButtons,
|
|
913
|
-
/* @__PURE__ */ (0,
|
|
948
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lobby2.ReadyButton, { color: p1Drawn, ready: ready[1], onToggleReady: toggleP1Ready, surfaceColor: readySurface, dark, style: !p2IsHuman && p1PickerOpen && styles3.readyButtonHidden })
|
|
914
949
|
] });
|
|
915
950
|
const optionsRow = loadout.options({
|
|
916
951
|
host: controlsHost,
|
|
@@ -924,15 +959,15 @@ function LoadoutScreen({ game }) {
|
|
|
924
959
|
onReset: showMetaInSharedBand ? void 0 : loadout.reset
|
|
925
960
|
});
|
|
926
961
|
const optionsPopoverOpen = controlsHost.openId !== null && loadout.optionIds.includes(controlsHost.openId);
|
|
927
|
-
const sharedControls = showMetaInSharedBand ? /* @__PURE__ */ (0,
|
|
962
|
+
const sharedControls = showMetaInSharedBand ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lobby2.SharedActionBand, { onBack: import_core6.safeBack, onSettings: () => setSettingsOpen(true), onRandomize: loadout.randomize, onReset: loadout.reset, fg, popoverOpen: optionsPopoverOpen, children: optionsRow }) : optionsRow;
|
|
928
963
|
const p2Control = p2IsHuman ? loadout.seatControl(2, p2Host, { ...controlLook, seatColor: p2Drawn }) : void 0;
|
|
929
|
-
const p2Panel = p2IsHuman && /* @__PURE__ */ (0,
|
|
930
|
-
return /* @__PURE__ */ (0,
|
|
931
|
-
/* @__PURE__ */ (0,
|
|
932
|
-
/* @__PURE__ */ (0,
|
|
933
|
-
p2ZoneStyle && /* @__PURE__ */ (0,
|
|
934
|
-
!showMetaInSharedBand && /* @__PURE__ */ (0,
|
|
935
|
-
p2IsHuman ? /* @__PURE__ */ (0,
|
|
964
|
+
const p2Panel = p2IsHuman && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lobby2.PlayerSetupPanel, { idPrefix: "p2", host: p2Host, color: p2Color, onColorChange: handleP2ColorChange, swatches: import_auto_paper5.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");
|
|
965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native6.View, { style: [styles3.container, { backgroundColor: bg }], children: [
|
|
966
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native6.View, { style: styles3.frame, children: [
|
|
967
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_chrome6.PressAwayOverlay, { active: controlsHost.openId !== null, onPress: controlsHost.close }),
|
|
968
|
+
p2ZoneStyle && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_chrome6.PressAwayOverlay, { active: controlsHost.openId !== null || p2Host.openId !== null, onPress: p2Host.close, style: p2ZoneStyle }),
|
|
969
|
+
!showMetaInSharedBand && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_chrome6.CornerActionButtons, { onBack: import_core6.safeBack, onSettings: () => setSettingsOpen(true), fg, insets }),
|
|
970
|
+
p2IsHuman ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
936
971
|
import_split_screen.DualZoneLayout,
|
|
937
972
|
{
|
|
938
973
|
panelLayout,
|
|
@@ -944,16 +979,16 @@ function LoadoutScreen({ game }) {
|
|
|
944
979
|
p2Elevated: p2Host.openId !== null,
|
|
945
980
|
sharedElevated: optionsPopoverOpen
|
|
946
981
|
}
|
|
947
|
-
) : /* @__PURE__ */ (0,
|
|
948
|
-
seatsInOptions ? /* @__PURE__ */ (0,
|
|
982
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native6.View, { style: styles3.stackedZone, children: [
|
|
983
|
+
seatsInOptions ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native6.View, { style: p1PickerOpen && styles3.raised, children: sharedControls }) : sharedControls,
|
|
949
984
|
seatOne
|
|
950
985
|
] })
|
|
951
986
|
] }),
|
|
952
|
-
/* @__PURE__ */ (0,
|
|
987
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SettingsDialog, { visible: settingsOpen, onDismiss: () => setSettingsOpen(false), onShowHowToPlay: () => openFor(game.id), showProfile: true })
|
|
953
988
|
] });
|
|
954
989
|
}
|
|
955
990
|
function halfOf(color) {
|
|
956
|
-
const rgb = (0,
|
|
991
|
+
const rgb = (0, import_auto_paper5.getRgb)(color);
|
|
957
992
|
return rgb ? `rgba(${rgb.r},${rgb.g},${rgb.b},0.5)` : void 0;
|
|
958
993
|
}
|
|
959
994
|
var styles3 = import_react_native6.StyleSheet.create({
|
|
@@ -1030,24 +1065,24 @@ var styles3 = import_react_native6.StyleSheet.create({
|
|
|
1030
1065
|
});
|
|
1031
1066
|
|
|
1032
1067
|
// src/screens/GameRoute.tsx
|
|
1033
|
-
var
|
|
1068
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1034
1069
|
function LoadoutRoute() {
|
|
1035
|
-
const { game: id } = (0,
|
|
1070
|
+
const { game: id } = (0, import_expo_router8.useLocalSearchParams)();
|
|
1036
1071
|
const game = usePackGame(id);
|
|
1037
|
-
if (!game) return /* @__PURE__ */ (0,
|
|
1038
|
-
if (!hasLoadout(game)) return /* @__PURE__ */ (0,
|
|
1039
|
-
return /* @__PURE__ */ (0,
|
|
1072
|
+
if (!game) return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_expo_router8.Redirect, { href: "/" });
|
|
1073
|
+
if (!hasLoadout(game)) return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_expo_router8.Redirect, { href: playHref(game.id) });
|
|
1074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LoadoutScreen, { game }, game.id);
|
|
1040
1075
|
}
|
|
1041
1076
|
function hasLoadout(game) {
|
|
1042
1077
|
return !!game.useLoadout;
|
|
1043
1078
|
}
|
|
1044
1079
|
function PlayRoute() {
|
|
1045
|
-
const { game: id } = (0,
|
|
1080
|
+
const { game: id } = (0, import_expo_router8.useLocalSearchParams)();
|
|
1046
1081
|
const game = usePackGame(id);
|
|
1047
1082
|
useResumePoint(game?.resumable ? game.id : null);
|
|
1048
|
-
if (!game) return /* @__PURE__ */ (0,
|
|
1083
|
+
if (!game) return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_expo_router8.Redirect, { href: "/" });
|
|
1049
1084
|
const { PlayScreen } = game;
|
|
1050
|
-
return /* @__PURE__ */ (0,
|
|
1085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(PlayScreen, {}, game.id);
|
|
1051
1086
|
}
|
|
1052
1087
|
function useResumePoint(gameId) {
|
|
1053
1088
|
const { setLastActiveGame, clearLastActiveGame } = useLastActiveGame();
|
|
@@ -1061,11 +1096,11 @@ function useResumePoint(gameId) {
|
|
|
1061
1096
|
}
|
|
1062
1097
|
|
|
1063
1098
|
// src/screens/HomeScreen.tsx
|
|
1064
|
-
var
|
|
1099
|
+
var import_auto_paper6 = require("@rific/auto-paper");
|
|
1065
1100
|
var import_feedback_press3 = require("@rific/feedback-press");
|
|
1066
|
-
var
|
|
1067
|
-
var
|
|
1068
|
-
var
|
|
1101
|
+
var import_chrome7 = require("@tastic/hud/chrome");
|
|
1102
|
+
var import_profile9 = require("@tastic/profile");
|
|
1103
|
+
var import_expo_router9 = require("expo-router");
|
|
1069
1104
|
var import_react16 = require("react");
|
|
1070
1105
|
var import_react_native9 = require("react-native");
|
|
1071
1106
|
var import_react_native_paper = require("react-native-paper");
|
|
@@ -1152,7 +1187,7 @@ function useHomeLayout(withPicker = true) {
|
|
|
1152
1187
|
}
|
|
1153
1188
|
|
|
1154
1189
|
// src/screens/HomeScreen.tsx
|
|
1155
|
-
var
|
|
1190
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1156
1191
|
function HomeScreen() {
|
|
1157
1192
|
const pack = usePack();
|
|
1158
1193
|
const { consumeResumeGame } = useLastActiveGame();
|
|
@@ -1164,19 +1199,19 @@ function HomeScreen() {
|
|
|
1164
1199
|
(0, import_react16.useEffect)(() => {
|
|
1165
1200
|
if (!resumeGame) autoShowPack();
|
|
1166
1201
|
}, [resumeGame, autoShowPack]);
|
|
1167
|
-
if (resumeGame) return /* @__PURE__ */ (0,
|
|
1168
|
-
return /* @__PURE__ */ (0,
|
|
1202
|
+
if (resumeGame) return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_expo_router9.Redirect, { href: pack.resumeHref?.(resumeGame.id) ?? playHref(resumeGame.id) });
|
|
1203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(HomeMenu, {});
|
|
1169
1204
|
}
|
|
1170
1205
|
function HomeMenu() {
|
|
1171
1206
|
const pack = usePack();
|
|
1172
1207
|
const showPicker = pack.homePlayerPicker !== false;
|
|
1173
1208
|
const layout = useHomeLayout(showPicker);
|
|
1174
1209
|
const { insets } = layout;
|
|
1175
|
-
const { dark, colors } = (0,
|
|
1210
|
+
const { dark, colors } = (0, import_auto_paper6.useAutoPaperTheme)();
|
|
1176
1211
|
const { openFirstTime, openFor, openPack } = useGameGuide();
|
|
1177
1212
|
const [settingsOpen, setSettingsOpen] = (0, import_react16.useState)(false);
|
|
1178
1213
|
const [rulesGame, setRulesGame] = (0, import_react16.useState)(null);
|
|
1179
|
-
const isFocused = (0,
|
|
1214
|
+
const isFocused = (0, import_expo_router9.useIsFocused)();
|
|
1180
1215
|
const [appState, setAppState] = (0, import_react16.useState)(import_react_native9.AppState.currentState);
|
|
1181
1216
|
(0, import_react16.useEffect)(() => {
|
|
1182
1217
|
const subscription = import_react_native9.AppState.addEventListener("change", setAppState);
|
|
@@ -1186,7 +1221,7 @@ function HomeMenu() {
|
|
|
1186
1221
|
const { profiles, lastSelected, selectProfile } = useProfiles();
|
|
1187
1222
|
const { seatTwo } = useOpponent();
|
|
1188
1223
|
const { p1Color, p2Color, handleP1ColorChange } = useSeatColors(seatTwo === "person");
|
|
1189
|
-
const pickerHost = (0,
|
|
1224
|
+
const pickerHost = (0, import_chrome7.usePopoverHost)();
|
|
1190
1225
|
const selectedProfile = profiles.find((p) => p.id === lastSelected[1]) ?? null;
|
|
1191
1226
|
const tiled = pack.games.some((game) => game.Preview);
|
|
1192
1227
|
const isWide = useFrozenWhileHidden(tiled && layout.isWide, !isFocused);
|
|
@@ -1209,42 +1244,42 @@ function HomeMenu() {
|
|
|
1209
1244
|
const [tabLabel, setTabLabel] = (0, import_react16.useState)(() => tabs?.[0].label ?? null);
|
|
1210
1245
|
const tab = tabs ? tabs.find((t) => t.label === tabLabel) ?? tabs[0] : null;
|
|
1211
1246
|
const tabButtons = (0, import_react16.useMemo)(() => tabs?.map(({ label }) => ({ value: label, label, labelStyle: pack.labelStyle })) ?? [], [tabs, pack.labelStyle]);
|
|
1212
|
-
const tabBar = tab && /* @__PURE__ */ (0,
|
|
1247
|
+
const tabBar = tab && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native_paper.SegmentedButtons, { value: tab.label, onValueChange: setTabLabel, buttons: tabButtons, theme: SEGMENT_THEME, style: [styles4.tabs, pack.Backdrop && { backgroundColor: colors.surface }] });
|
|
1213
1248
|
const columnClamp = useClampOnShrink();
|
|
1214
1249
|
const gridClamp = useClampOnShrink();
|
|
1215
|
-
const openGame = (0, import_react16.useCallback)((game) => openFirstTime(game.id, () =>
|
|
1250
|
+
const openGame = (0, import_react16.useCallback)((game) => openFirstTime(game.id, () => import_expo_router9.router.push(game.useLoadout ? loadoutHref(game.id) : playHref(game.id))), [openFirstTime]);
|
|
1216
1251
|
const openRules = (0, import_react16.useCallback)((game) => game.Rules ? setRulesGame(game) : openFor(game.id), [openFor]);
|
|
1217
|
-
const colorSection = { value: p1Color, onChange: handleP1ColorChange, swatches:
|
|
1252
|
+
const colorSection = { value: p1Color, onChange: handleP1ColorChange, swatches: import_auto_paper6.defaultColors, caption: selectedProfile ? pack.colorCaption : void 0, previewValue: previewColor ? (hex) => previewColor(hex, dark) : void 0 };
|
|
1218
1253
|
const usePickerAlign = pack.usePickerAlign ?? noPickerAlign;
|
|
1219
|
-
const pickerSize = (0,
|
|
1254
|
+
const pickerSize = (0, import_profile9.getProfilePickerContentSize)(profiles.length, true, colorSection);
|
|
1220
1255
|
const pickerAlign = usePickerAlign(pickerHost.openId === `${SEAT_ONE_PICKER}-profile`, pickerSize.width, pickerSize.height);
|
|
1221
|
-
const picker = /* @__PURE__ */ (0,
|
|
1222
|
-
const pressAway = /* @__PURE__ */ (0,
|
|
1256
|
+
const picker = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_profile9.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_router9.router.push(PROFILES_HREF), colorSection, alignOverride: pickerAlign, triggerStyle });
|
|
1257
|
+
const pressAway = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_chrome7.PressAwayOverlay, { active: pickerHost.openId !== null, onPress: pickerHost.close, style: styles4.pressAway });
|
|
1223
1258
|
const RulesSheet = rulesGame?.Rules;
|
|
1224
|
-
return /* @__PURE__ */ (0,
|
|
1225
|
-
/* @__PURE__ */ (0,
|
|
1226
|
-
isWide ? /* @__PURE__ */ (0,
|
|
1259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native9.View, { style: [styles4.container, { backgroundColor: bg }], children: [
|
|
1260
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native9.View, { style: styles4.frame, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(RulesHost, { enabled: pack.games.some((game) => game.Rules), children: [
|
|
1261
|
+
isWide ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
1227
1262
|
pressAway,
|
|
1228
|
-
/* @__PURE__ */ (0,
|
|
1229
|
-
tabBar && /* @__PURE__ */ (0,
|
|
1230
|
-
/* @__PURE__ */ (0,
|
|
1263
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_auto_paper6.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: [
|
|
1264
|
+
tabBar && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native9.View, { style: [styles4.wideTabs, { width: layout.rightPaneWidth }], children: tabBar }),
|
|
1265
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native9.View, { style: [styles4.grid, { width: layout.rightPaneWidth }], children: pack.games.map((game) => /* @__PURE__ */ (0, import_jsx_runtime17.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)) })
|
|
1231
1266
|
] }),
|
|
1232
|
-
/* @__PURE__ */ (0,
|
|
1233
|
-
/* @__PURE__ */ (0,
|
|
1234
|
-
showPicker && /* @__PURE__ */ (0,
|
|
1267
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.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: [
|
|
1268
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(pack.HeroTitle, { words: pack.wordmark, color: fg, p1Color, p2Color, active: heroActive, fit: layout.heroFit }),
|
|
1269
|
+
showPicker && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native9.View, { style: styles4.widePicker, children: picker })
|
|
1235
1270
|
] })
|
|
1236
|
-
] }) : /* @__PURE__ */ (0,
|
|
1271
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_auto_paper6.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: [
|
|
1237
1272
|
pressAway,
|
|
1238
|
-
/* @__PURE__ */ (0,
|
|
1239
|
-
showPicker && /* @__PURE__ */ (0,
|
|
1240
|
-
tabBar && /* @__PURE__ */ (0,
|
|
1241
|
-
/* @__PURE__ */ (0,
|
|
1273
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(pack.HeroTitle, { words: pack.wordmark, color: fg, p1Color, p2Color, active: heroActive }),
|
|
1274
|
+
showPicker && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native9.View, { style: [styles4.picker, pickerHost.openId !== null && styles4.pickerOpen], children: picker }),
|
|
1275
|
+
tabBar && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native9.View, { style: styles4.listWidth, children: tabBar }),
|
|
1276
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native9.View, { style: styles4.list, children: pack.games.map((game) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GameRow, { game, hidden: isHidden(tab, game), dark, p1Color, p2Color, previewRevealed: previewsRevealed, onPress: () => openGame(game), onRules: hasRules(game) ? () => openRules(game) : void 0 }, game.id)) })
|
|
1242
1277
|
] }),
|
|
1243
|
-
/* @__PURE__ */ (0,
|
|
1244
|
-
/* @__PURE__ */ (0,
|
|
1245
|
-
RulesSheet && /* @__PURE__ */ (0,
|
|
1278
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.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_router9.router.push(STATS_HREF), accessibilityLabel: "Stats & Achievements" }),
|
|
1279
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.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" }),
|
|
1280
|
+
RulesSheet && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(RulesSheet, { visible: true, onDismiss: () => setRulesGame(null) })
|
|
1246
1281
|
] }) }),
|
|
1247
|
-
/* @__PURE__ */ (0,
|
|
1282
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SettingsDialog, { visible: settingsOpen, onDismiss: () => setSettingsOpen(false), onShowHowToPlay: pack.guide ? openPack : void 0, showProfile: true })
|
|
1248
1283
|
] });
|
|
1249
1284
|
}
|
|
1250
1285
|
var SEAT_ONE_PICKER = "home-p1";
|
|
@@ -1281,45 +1316,45 @@ function hasRules(game) {
|
|
|
1281
1316
|
return !!(game.Rules || game.guide);
|
|
1282
1317
|
}
|
|
1283
1318
|
function RulesHost({ enabled, children }) {
|
|
1284
|
-
return enabled ? /* @__PURE__ */ (0,
|
|
1319
|
+
return enabled ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native_paper.Portal.Host, { children }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_jsx_runtime17.Fragment, { children });
|
|
1285
1320
|
}
|
|
1286
1321
|
var ROW_BLURB_LINES = 3;
|
|
1287
1322
|
function GameRow({ game, hidden, dark, p1Color, p2Color, previewRevealed, onPress, onRules }) {
|
|
1288
1323
|
const { titleStyle } = usePack();
|
|
1289
|
-
const well = (0,
|
|
1324
|
+
const well = (0, import_chrome7.useWellColors)();
|
|
1290
1325
|
const GameIcon = game.icon;
|
|
1291
1326
|
return (
|
|
1292
1327
|
// The rules button sits beside the row's own button, laid over its end, not inside it: a button
|
|
1293
1328
|
// inside a button is invalid on the web.
|
|
1294
|
-
/* @__PURE__ */ (0,
|
|
1295
|
-
/* @__PURE__ */ (0,
|
|
1296
|
-
game.Preview ? /* @__PURE__ */ (0,
|
|
1297
|
-
/* @__PURE__ */ (0,
|
|
1298
|
-
/* @__PURE__ */ (0,
|
|
1299
|
-
/* @__PURE__ */ (0,
|
|
1329
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native9.View, { style: hidden ? styles4.hidden : void 0, children: [
|
|
1330
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_feedback_press3.Pressable, { onPress, style: [styles4.row, { backgroundColor: well.bg }], accessibilityRole: "button", accessibilityLabel: game.title, children: [
|
|
1331
|
+
game.Preview ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PreviewBox, { game, width: ROW_PREVIEW_WIDTH, revealed: previewRevealed, dark, p1Color, p2Color }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native9.View, { style: [styles4.rowIcon, { backgroundColor: dark ? ICON_DARK_BG : ICON_LIGHT_BG }], children: GameIcon && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GameIcon, { size: ROW_ICON_SIZE, p1Color, p2Color, dark }) }),
|
|
1332
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native9.View, { style: styles4.rowText, children: [
|
|
1333
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native_paper.Text, { variant: "titleLarge", style: [styles4.rowTitle, { color: well.fg }, titleStyle], numberOfLines: 1, children: game.title }),
|
|
1334
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native_paper.Text, { variant: "bodyMedium", style: { color: well.fgMuted }, numberOfLines: ROW_BLURB_LINES, children: game.blurb })
|
|
1300
1335
|
] })
|
|
1301
1336
|
] }),
|
|
1302
|
-
onRules && /* @__PURE__ */ (0,
|
|
1337
|
+
onRules && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_feedback_press3.Pressable, { onPress: onRules, style: styles4.rulesButton, hitSlop: 12, accessibilityRole: "button", accessibilityLabel: `${game.title} rules`, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native_paper.Icon, { source: "information-outline", size: 22, color: well.fgMuted }) })
|
|
1303
1338
|
] })
|
|
1304
1339
|
);
|
|
1305
1340
|
}
|
|
1306
1341
|
function GameTile({ game, hidden, width, previewWidth, dark, p1Color, p2Color, previewRevealed, onPress, onRules }) {
|
|
1307
1342
|
const { titleStyle } = usePack();
|
|
1308
|
-
const well = (0,
|
|
1309
|
-
return /* @__PURE__ */ (0,
|
|
1310
|
-
/* @__PURE__ */ (0,
|
|
1311
|
-
/* @__PURE__ */ (0,
|
|
1312
|
-
/* @__PURE__ */ (0,
|
|
1313
|
-
/* @__PURE__ */ (0,
|
|
1343
|
+
const well = (0, import_chrome7.useWellColors)();
|
|
1344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native9.View, { style: [{ width }, hidden && styles4.hidden], children: [
|
|
1345
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_feedback_press3.Pressable, { onPress, style: [styles4.tile, { backgroundColor: well.bg }], accessibilityRole: "button", accessibilityLabel: game.title, children: [
|
|
1346
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PreviewBox, { game, width: previewWidth, revealed: previewRevealed, dark, p1Color, p2Color }),
|
|
1347
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native_paper.Text, { variant: "titleMedium", style: [styles4.rowTitle, { color: well.fg }, titleStyle], numberOfLines: 1, children: game.title }),
|
|
1348
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native_paper.Text, { variant: "bodySmall", style: { color: well.fgMuted }, numberOfLines: 3, children: game.blurb })
|
|
1314
1349
|
] }),
|
|
1315
|
-
onRules && /* @__PURE__ */ (0,
|
|
1350
|
+
onRules && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_feedback_press3.Pressable, { onPress: onRules, style: styles4.tileRulesButton, hitSlop: 12, accessibilityRole: "button", accessibilityLabel: `${game.title} rules`, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native_paper.Icon, { source: "information-outline", size: 20, color: "#FFFFFF" }) })
|
|
1316
1351
|
] });
|
|
1317
1352
|
}
|
|
1318
1353
|
function PreviewBox({ game, width, revealed, dark, p1Color, p2Color }) {
|
|
1319
1354
|
const height = Math.round(width / PREVIEW_ASPECT);
|
|
1320
1355
|
const { Preview, icon: GameIcon } = game;
|
|
1321
1356
|
const iconSize = Math.min(height, ROW_ICON_SIZE);
|
|
1322
|
-
return /* @__PURE__ */ (0,
|
|
1357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.jsx)(Preview, { width, height, p1Color, p2Color, dark }) : GameIcon && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native9.View, { style: [styles4.previewIcon, { width: iconSize, height: iconSize, borderRadius: iconSize * 0.22 }], children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GameIcon, { size: iconSize, p1Color, p2Color, dark }) }) });
|
|
1323
1358
|
}
|
|
1324
1359
|
var ROW_ICON_SIZE = 56;
|
|
1325
1360
|
var ICON_LIGHT_BG = "#FAFAFA";
|
|
@@ -1390,7 +1425,7 @@ var styles4 = import_react_native9.StyleSheet.create({
|
|
|
1390
1425
|
row: {
|
|
1391
1426
|
alignItems: "center",
|
|
1392
1427
|
borderRadius: 12,
|
|
1393
|
-
boxShadow:
|
|
1428
|
+
boxShadow: import_chrome7.WELL_SHADOW,
|
|
1394
1429
|
flexDirection: "row",
|
|
1395
1430
|
gap: 14,
|
|
1396
1431
|
padding: 14,
|
|
@@ -1426,7 +1461,7 @@ var styles4 = import_react_native9.StyleSheet.create({
|
|
|
1426
1461
|
// The same well as a row, turned on its side.
|
|
1427
1462
|
tile: {
|
|
1428
1463
|
borderRadius: 12,
|
|
1429
|
-
boxShadow:
|
|
1464
|
+
boxShadow: import_chrome7.WELL_SHADOW,
|
|
1430
1465
|
gap: 6,
|
|
1431
1466
|
padding: HOME_TILE_PADDING
|
|
1432
1467
|
},
|
|
@@ -1468,33 +1503,17 @@ var styles4 = import_react_native9.StyleSheet.create({
|
|
|
1468
1503
|
}
|
|
1469
1504
|
});
|
|
1470
1505
|
|
|
1471
|
-
// src/screens/ProfilesRoute.tsx
|
|
1472
|
-
var import_auto_paper6 = require("@rific/auto-paper");
|
|
1473
|
-
var import_chrome6 = require("@tastic/hud/chrome");
|
|
1474
|
-
var import_profile8 = require("@tastic/profile");
|
|
1475
|
-
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1476
|
-
var ROSTER_MAX_WIDTH = 640;
|
|
1477
|
-
function useRosterAlign(open, contentWidth, contentHeight) {
|
|
1478
|
-
const { usePickerAlign } = usePack();
|
|
1479
|
-
return usePickerAlign(open, contentWidth, contentHeight, { maxContentWidth: ROSTER_MAX_WIDTH });
|
|
1480
|
-
}
|
|
1481
|
-
function ProfilesRoute() {
|
|
1482
|
-
const { profiles, createProfile, updateProfile, deleteProfile } = useProfiles();
|
|
1483
|
-
const { Backdrop, foreground, newProfileColor, usePickerAlign } = usePack();
|
|
1484
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_chrome6.ScreenFrame, { 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 }) });
|
|
1485
|
-
}
|
|
1486
|
-
|
|
1487
1506
|
// src/screens/StatsScreen.tsx
|
|
1488
1507
|
var import_auto_paper7 = require("@rific/auto-paper");
|
|
1489
|
-
var
|
|
1490
|
-
var
|
|
1491
|
-
var
|
|
1508
|
+
var import_chrome8 = require("@tastic/hud/chrome");
|
|
1509
|
+
var import_profile10 = require("@tastic/profile");
|
|
1510
|
+
var import_expo_router10 = require("expo-router");
|
|
1492
1511
|
var import_react17 = require("react");
|
|
1493
1512
|
var import_react_native10 = require("react-native");
|
|
1494
1513
|
var import_react_native_paper2 = require("react-native-paper");
|
|
1495
1514
|
var import_react_native_safe_area_context5 = require("react-native-safe-area-context");
|
|
1496
1515
|
var import_react_redux10 = require("react-redux");
|
|
1497
|
-
var
|
|
1516
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1498
1517
|
var STATS = "stats";
|
|
1499
1518
|
var ACHIEVEMENTS = "achievements";
|
|
1500
1519
|
var TABS = [
|
|
@@ -1511,11 +1530,11 @@ var MANAGE = "__manage__";
|
|
|
1511
1530
|
var MANAGE_OPTION = { value: MANAGE, label: "Manage", icon: "account-cog-outline", dividerBefore: true };
|
|
1512
1531
|
var STATS_MAX_WIDTH = 640;
|
|
1513
1532
|
function StatsScreen() {
|
|
1514
|
-
const pickerHost = (0,
|
|
1515
|
-
return /* @__PURE__ */ (0,
|
|
1533
|
+
const pickerHost = (0, import_chrome8.usePopoverHost)();
|
|
1534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(StatsPressAway, { host: pickerHost, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_chrome8.ScreenFrame, { portalHost: true, maxContentWidth: STATS_MAX_WIDTH, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(StatsContent, { pickerHost }) }) });
|
|
1516
1535
|
}
|
|
1517
1536
|
function StatsPressAway({ host, children }) {
|
|
1518
|
-
return /* @__PURE__ */ (0,
|
|
1537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native10.View, { testID: "stats-press-away", style: styles5.screen, onStartShouldSetResponder: () => host.openId !== null, onResponderRelease: host.close, children });
|
|
1519
1538
|
}
|
|
1520
1539
|
var useNoPackReset = () => null;
|
|
1521
1540
|
var noPickerAlign2 = () => void 0;
|
|
@@ -1548,23 +1567,23 @@ function StatsContent({ pickerHost }) {
|
|
|
1548
1567
|
const packReset = usePackReset();
|
|
1549
1568
|
const reset = resetFor(pack, packReset, profileId, profiles, games, () => games.forEach((g) => g.resetStats && dispatch(g.resetStats())));
|
|
1550
1569
|
const usePickerAlign = pack.usePickerAlign ?? noPickerAlign2;
|
|
1551
|
-
const playerSize = (0,
|
|
1552
|
-
const gameSize = (0,
|
|
1570
|
+
const playerSize = (0, import_profile10.getOptionPickerContentSize)(playerOptions);
|
|
1571
|
+
const gameSize = (0, import_profile10.getOptionPickerContentSize)(gameOptions.length);
|
|
1553
1572
|
const playerAlign = usePickerAlign(pickerHost.openId === PLAYER_PICKER_ID, playerSize.width, playerSize.height);
|
|
1554
1573
|
const gameAlign = usePickerAlign(pickerHost.openId === GAME_PICKER_ID, gameSize.width, gameSize.height);
|
|
1555
1574
|
const surface = pack.Backdrop ? { backgroundColor: colors.surface } : void 0;
|
|
1556
1575
|
const triggerStyle = pack.Backdrop ? [styles5.pill, surface] : void 0;
|
|
1557
1576
|
const PackTabContent = packTab?.Content;
|
|
1558
|
-
return /* @__PURE__ */ (0,
|
|
1559
|
-
/* @__PURE__ */ (0,
|
|
1560
|
-
/* @__PURE__ */ (0,
|
|
1561
|
-
/* @__PURE__ */ (0,
|
|
1562
|
-
/* @__PURE__ */ (0,
|
|
1563
|
-
showGamePicker && /* @__PURE__ */ (0,
|
|
1577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_chrome8.BaseStatsScreen, { title, titleStyle: pack.titleStyle, onBack: import_core6.safeBack, insets, onReset: reset.onReset, resetLabel: reset.label, resetConfirmTitle: reset.title, resetConfirmBody: reset.body, fg: pack.foreground, bg: pack.Backdrop ? "transparent" : void 0, children: [
|
|
1578
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_chrome8.PressAwayOverlay, { active: pickerHost.openId !== null, onPress: pickerHost.close, style: styles5.pressAway }),
|
|
1579
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native_paper2.SegmentedButtons, { value: tab, onValueChange: setTab, buttons: tabButtons, theme: SEGMENT_THEME, style: [styles5.tabs, surface] }),
|
|
1580
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native10.View, { style: [styles5.filters, pickerHost.openId !== null && styles5.filtersOpen], onStartShouldSetResponder: () => pickerHost.openId !== null, children: [
|
|
1581
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_profile10.OptionPicker, { id: PLAYER_PICKER_ID, host: pickerHost, options: playerOptions, value: profileId ?? EVERYONE, onChange: (value) => value === MANAGE ? import_expo_router10.router.push(PROFILES_HREF) : setSelectedProfileId(value === EVERYONE ? null : value), color: colors.primary, dark, icon: profileId ? "account" : "account-group", alignOverride: playerAlign, triggerStyle }),
|
|
1582
|
+
showGamePicker && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_profile10.OptionPicker, { id: GAME_PICKER_ID, host: pickerHost, options: gameOptions, value: gameId, onChange: setGameId, color: colors.primary, dark, icon: "view-grid-outline", alignOverride: gameAlign, triggerStyle })
|
|
1564
1583
|
] }),
|
|
1565
|
-
tab === STATS && pack.StatsSections && /* @__PURE__ */ (0,
|
|
1566
|
-
PackTabContent && /* @__PURE__ */ (0,
|
|
1567
|
-
tab === ACHIEVEMENTS && pack.AchievementList ? /* @__PURE__ */ (0,
|
|
1584
|
+
tab === STATS && pack.StatsSections && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(pack.StatsSections, { profileId, gameId: gameId === ALL_GAMES ? null : gameId }),
|
|
1585
|
+
PackTabContent && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PackTabContent, { profileId, gameId: gameId === ALL_GAMES ? null : gameId }),
|
|
1586
|
+
tab === ACHIEVEMENTS && pack.AchievementList ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(pack.AchievementList, { profileId }) : (tab === STATS || tab === ACHIEVEMENTS) && games.map((game) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(GameStats, { game, tab, profileId, showTitle: games.length > 1 && pack.statsGameTitles !== false, titleColor: fg }, game.id))
|
|
1568
1587
|
] });
|
|
1569
1588
|
}
|
|
1570
1589
|
function resetFor(pack, packReset, profileId, profiles, games, resetGames) {
|
|
@@ -1580,9 +1599,9 @@ function GameStats({ game, tab, profileId, showTitle, titleColor }) {
|
|
|
1580
1599
|
const { StatsSections, AchievementList } = game;
|
|
1581
1600
|
const Sections = tab === STATS ? StatsSections : AchievementList;
|
|
1582
1601
|
if (!Sections) return null;
|
|
1583
|
-
return /* @__PURE__ */ (0,
|
|
1584
|
-
showTitle && /* @__PURE__ */ (0,
|
|
1585
|
-
/* @__PURE__ */ (0,
|
|
1602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native10.View, { style: styles5.game, children: [
|
|
1603
|
+
showTitle && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native_paper2.Text, { variant: "titleLarge", style: [styles5.gameTitle, { color: titleColor }, titleStyle], children: game.title }),
|
|
1604
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Sections, { profileId })
|
|
1586
1605
|
] });
|
|
1587
1606
|
}
|
|
1588
1607
|
var styles5 = import_react_native10.StyleSheet.create({
|
|
@@ -1620,10 +1639,10 @@ var styles5 = import_react_native10.StyleSheet.create({
|
|
|
1620
1639
|
|
|
1621
1640
|
// src/components/imageGameIcon.tsx
|
|
1622
1641
|
var import_react_native11 = require("react-native");
|
|
1623
|
-
var
|
|
1642
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1624
1643
|
function imageGameIcon(images) {
|
|
1625
1644
|
return function ImageGameIcon({ size, dark }) {
|
|
1626
|
-
return /* @__PURE__ */ (0,
|
|
1645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native11.Image, { source: dark ? images.dark : images.light, style: { height: size, width: size }, accessibilityIgnoresInvertColors: true });
|
|
1627
1646
|
};
|
|
1628
1647
|
}
|
|
1629
1648
|
|
|
@@ -1634,7 +1653,7 @@ var import_react18 = require("react");
|
|
|
1634
1653
|
var import_react_native12 = require("react-native");
|
|
1635
1654
|
var import_react_native_reanimated3 = __toESM(require("react-native-reanimated"));
|
|
1636
1655
|
var import_react_native_safe_area_context6 = require("react-native-safe-area-context");
|
|
1637
|
-
var
|
|
1656
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1638
1657
|
var MATCH_CHIPS_FADE_MS = 150;
|
|
1639
1658
|
var CHIP_SIZE = 48;
|
|
1640
1659
|
var EDGE_PAD = 8;
|
|
@@ -1656,9 +1675,9 @@ function MatchChips({ playing, faceToFace, centerLineY, onBack, onSettings }) {
|
|
|
1656
1675
|
const backSlot = { top, left: EDGE_PAD + insets.left };
|
|
1657
1676
|
const settingsSlot = { top, right: EDGE_PAD + insets.right };
|
|
1658
1677
|
const pointerEvents = visible ? "box-none" : "none";
|
|
1659
|
-
return /* @__PURE__ */ (0,
|
|
1660
|
-
/* @__PURE__ */ (0,
|
|
1661
|
-
/* @__PURE__ */ (0,
|
|
1678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
1679
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native_reanimated3.default.View, { pointerEvents, style: [styles6.slot, backSlot, fadeStyle], testID: "match-chips-back", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_feedback_press4.IconButton, { icon: "arrow-left", iconColor, containerColor, style: styles6.chip, size: 24, onPress: onBack, accessibilityLabel: "Back" }) }),
|
|
1680
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native_reanimated3.default.View, { pointerEvents, style: [styles6.slot, settingsSlot, fadeStyle], testID: "match-chips-settings", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_feedback_press4.IconButton, { icon: "cog", iconColor, containerColor, style: styles6.chip, size: 24, onPress: onSettings, accessibilityLabel: "Settings" }) })
|
|
1662
1681
|
] });
|
|
1663
1682
|
}
|
|
1664
1683
|
var styles6 = import_react_native12.StyleSheet.create({
|
|
@@ -1676,16 +1695,16 @@ function useActiveRound(game, defaults) {
|
|
|
1676
1695
|
}
|
|
1677
1696
|
|
|
1678
1697
|
// src/hooks/useBackBlock.ts
|
|
1679
|
-
var
|
|
1698
|
+
var import_expo_router11 = require("expo-router");
|
|
1680
1699
|
var import_react19 = require("react");
|
|
1681
|
-
function useBackBlock(held, onHeld, leave =
|
|
1700
|
+
function useBackBlock(held, onHeld, leave = import_core6.safeBack) {
|
|
1682
1701
|
const leavingRef = (0, import_react19.useRef)(false);
|
|
1683
1702
|
const [leaving, setLeaving] = (0, import_react19.useState)(false);
|
|
1684
1703
|
const leaveRef = (0, import_react19.useRef)(leave);
|
|
1685
1704
|
(0, import_react19.useEffect)(() => {
|
|
1686
1705
|
leaveRef.current = leave;
|
|
1687
1706
|
});
|
|
1688
|
-
(0,
|
|
1707
|
+
(0, import_expo_router11.usePreventRemove)(held && !leaving, ({ repeat }) => {
|
|
1689
1708
|
if (leavingRef.current) {
|
|
1690
1709
|
setLeaving(true);
|
|
1691
1710
|
repeat();
|
|
@@ -1706,7 +1725,7 @@ var import_redux_persist = require("redux-persist");
|
|
|
1706
1725
|
var import_auto_paper9 = require("@rific/auto-paper");
|
|
1707
1726
|
var import_core12 = require("@rific/core");
|
|
1708
1727
|
var import_feedback_press5 = require("@rific/feedback-press");
|
|
1709
|
-
var
|
|
1728
|
+
var import_profile11 = require("@tastic/profile");
|
|
1710
1729
|
function createShellReducers({ seatColors, appearance = "system", seatTheme }) {
|
|
1711
1730
|
return {
|
|
1712
1731
|
// Explicit primary/secondary triad (rather than a single seed expanded via harmony) so the pack's
|
|
@@ -1730,7 +1749,7 @@ function createShellReducers({ seatColors, appearance = "system", seatTheme }) {
|
|
|
1730
1749
|
// useSharedProfilesSync, wired in hooks/useProfiles.tsx) is layered on top of this as a separate
|
|
1731
1750
|
// sync target - this slice persisting normally via redux-persist is what gives it local-fallback
|
|
1732
1751
|
// behavior where the shared store isn't available, with no separate AsyncStorage path.
|
|
1733
|
-
profiles:
|
|
1752
|
+
profiles: import_profile11.profilesReducer,
|
|
1734
1753
|
profileSelection: profileSelectionSlice_default,
|
|
1735
1754
|
// The loadout's "remember this color for next time" memory (guest, CPU, and each profile's pick
|
|
1736
1755
|
// in this pack) - separate from `theme` above, which always reflects whatever's live right now.
|
|
@@ -1809,11 +1828,11 @@ function createGameGuideSlice(mountKey) {
|
|
|
1809
1828
|
|
|
1810
1829
|
// src/redux/onProfileRemoved.ts
|
|
1811
1830
|
var import_achievements = require("@tastic/achievements");
|
|
1812
|
-
var
|
|
1831
|
+
var import_profile12 = require("@tastic/profile");
|
|
1813
1832
|
function onProfileRemoved(reducer6, forget) {
|
|
1814
1833
|
return (state, action) => {
|
|
1815
1834
|
const next = reducer6(state, action);
|
|
1816
|
-
return
|
|
1835
|
+
return import_profile12.profilesActions.remove.match(action) ? forget(next, action.payload) : next;
|
|
1817
1836
|
};
|
|
1818
1837
|
}
|
|
1819
1838
|
function forgetProfileAchievements(dropStats) {
|
|
@@ -1827,7 +1846,7 @@ function forgetProfileAchievements(dropStats) {
|
|
|
1827
1846
|
// src/gameStats.tsx
|
|
1828
1847
|
var import_achievements2 = require("@tastic/achievements");
|
|
1829
1848
|
var import_react20 = require("react");
|
|
1830
|
-
var
|
|
1849
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1831
1850
|
var SEATS = [1, 2];
|
|
1832
1851
|
function createGameStats({ key, defaultStats, isValidStats, catalog, getProfileStatsView }) {
|
|
1833
1852
|
const { actions: actions6, reducer: sliceReducer } = (0, import_achievements2.createAchievementsSlice)({
|
|
@@ -1860,7 +1879,7 @@ function createGameStats({ key, defaultStats, isValidStats, catalog, getProfileS
|
|
|
1860
1879
|
[recordOutcome]
|
|
1861
1880
|
);
|
|
1862
1881
|
const value = (0, import_react20.useMemo)(() => ({ stats, unlockedAchievements, record, resetAll }), [stats, unlockedAchievements, record, resetAll]);
|
|
1863
|
-
return /* @__PURE__ */ (0,
|
|
1882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Context.Provider, { value, children });
|
|
1864
1883
|
}
|
|
1865
1884
|
function useStats() {
|
|
1866
1885
|
const ctx = (0, import_react20.useContext)(Context);
|
|
@@ -1936,6 +1955,7 @@ function createPlayerSettings({ id, defaults, distinctControls }) {
|
|
|
1936
1955
|
0 && (module.exports = {
|
|
1937
1956
|
DEFAULT_APP_SETTINGS,
|
|
1938
1957
|
DEFAULT_OPPONENT,
|
|
1958
|
+
EditProfileRoute,
|
|
1939
1959
|
GUEST_PLAYER_ID,
|
|
1940
1960
|
HomeScreen,
|
|
1941
1961
|
LoadoutRoute,
|