@tastic/shell 0.9.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -103,12 +103,13 @@ function usePackGame(id) {
103
103
  var import_auto_paper2 = require("@rific/auto-paper");
104
104
  var import_feedback_press2 = require("@rific/feedback-press");
105
105
  var import_toaster2 = require("@rific/toaster");
106
- var import_core4 = require("@tastic/core");
106
+ var import_core5 = require("@tastic/core");
107
+ var import_edge_guard2 = require("@tastic/edge-guard");
107
108
  var import_chrome2 = require("@tastic/hud/chrome");
108
109
  var import_profile3 = require("@tastic/profile");
109
110
  var Haptics = __toESM(require("expo-haptics"));
110
111
  var import_expo_router = require("expo-router");
111
- var import_react8 = require("react");
112
+ var import_react9 = require("react");
112
113
  var import_react_native3 = require("react-native");
113
114
  var import_react_native_gesture_handler = require("react-native-gesture-handler");
114
115
  var RNPaper2 = __toESM(require("react-native-paper"));
@@ -321,26 +322,56 @@ function WindowControlsInsets({ children }) {
321
322
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native_safe_area_context.SafeAreaInsetsContext.Provider, { value: vertical, children });
322
323
  }
323
324
 
324
- // src/hooks/useLastActiveGame.tsx
325
+ // src/hooks/useAppSettings.ts
325
326
  var import_react6 = require("react");
326
327
  var import_react_redux4 = require("react-redux");
327
328
 
328
- // src/redux/lastActiveGameSlice.ts
329
+ // src/redux/appSettingsSlice.ts
329
330
  var import_core3 = require("@rific/core");
330
- var { actions, reducer } = (0, import_core3.createSettingsSlice)("lastActiveGame", { initialState: { gameId: null } });
331
- var lastActiveGameActions = actions;
332
- var lastActiveGameSlice_default = reducer;
331
+ var DEFAULT_APP_SETTINGS = {
332
+ deferBottomEdgeGestures: false
333
+ };
334
+ var { actions, reducer } = (0, import_core3.createSettingsSlice)("appSettings", {
335
+ initialState: DEFAULT_APP_SETTINGS,
336
+ initializeMode: "merge",
337
+ fieldSetters: []
338
+ });
339
+ var appSettingsActions = actions;
340
+ var appSettingsSlice_default = reducer;
341
+
342
+ // src/hooks/useAppSettings.ts
343
+ function useAppSettings() {
344
+ const settings = (0, import_react_redux4.useSelector)((state) => state.appSettings);
345
+ const dispatch = (0, import_react_redux4.useDispatch)();
346
+ const setSettings = (0, import_react6.useCallback)(
347
+ (patch) => {
348
+ dispatch(appSettingsActions.initialize(patch));
349
+ },
350
+ [dispatch]
351
+ );
352
+ return { settings, setSettings };
353
+ }
354
+
355
+ // src/hooks/useLastActiveGame.tsx
356
+ var import_react7 = require("react");
357
+ var import_react_redux5 = require("react-redux");
358
+
359
+ // src/redux/lastActiveGameSlice.ts
360
+ var import_core4 = require("@rific/core");
361
+ var { actions: actions2, reducer: reducer2 } = (0, import_core4.createSettingsSlice)("lastActiveGame", { initialState: { gameId: null } });
362
+ var lastActiveGameActions = actions2;
363
+ var lastActiveGameSlice_default = reducer2;
333
364
 
334
365
  // src/hooks/useLastActiveGame.tsx
335
366
  var import_jsx_runtime8 = require("react/jsx-runtime");
336
- var LastActiveGameContext = (0, import_react6.createContext)(null);
367
+ var LastActiveGameContext = (0, import_react7.createContext)(null);
337
368
  function LastActiveGameProvider({ children }) {
338
- const store = (0, import_react_redux4.useStore)();
339
- const dispatch = (0, import_react_redux4.useDispatch)();
340
- const [initial] = (0, import_react6.useState)(() => store.getState().lastActiveGame?.gameId ?? null);
341
- const pendingResume = (0, import_react6.useRef)(initial);
342
- const persisted = (0, import_react6.useRef)(initial);
343
- const value = (0, import_react6.useMemo)(
369
+ const store = (0, import_react_redux5.useStore)();
370
+ const dispatch = (0, import_react_redux5.useDispatch)();
371
+ const [initial] = (0, import_react7.useState)(() => store.getState().lastActiveGame?.gameId ?? null);
372
+ const pendingResume = (0, import_react7.useRef)(initial);
373
+ const persisted = (0, import_react7.useRef)(initial);
374
+ const value = (0, import_react7.useMemo)(
344
375
  () => ({
345
376
  consumeResumeGame: () => {
346
377
  const game = pendingResume.current;
@@ -368,33 +399,33 @@ function LastActiveGameProvider({ children }) {
368
399
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(LastActiveGameContext.Provider, { value, children });
369
400
  }
370
401
  function useLastActiveGame() {
371
- const ctx = (0, import_react6.useContext)(LastActiveGameContext);
402
+ const ctx = (0, import_react7.useContext)(LastActiveGameContext);
372
403
  if (!ctx) throw new Error("useLastActiveGame must be used within a LastActiveGameProvider");
373
404
  return ctx;
374
405
  }
375
406
 
376
407
  // src/hooks/useProfiles.tsx
377
408
  var import_profile2 = require("@tastic/profile");
378
- var import_react7 = require("react");
379
- var import_react_redux5 = require("react-redux");
409
+ var import_react8 = require("react");
410
+ var import_react_redux6 = require("react-redux");
380
411
 
381
412
  // src/redux/profileSelectionSlice.ts
382
413
  var import_profile = require("@tastic/profile");
383
414
  var defaultProfileSelectionState = { 1: null, 2: null };
384
- var { actions: actions2, reducer: reducer2 } = (0, import_profile.createProfileSelectionSlice)("pack", defaultProfileSelectionState);
385
- var profileSelectionActions = actions2;
386
- var profileSelectionSlice_default = reducer2;
415
+ var { actions: actions3, reducer: reducer3 } = (0, import_profile.createProfileSelectionSlice)("pack", defaultProfileSelectionState);
416
+ var profileSelectionActions = actions3;
417
+ var profileSelectionSlice_default = reducer3;
387
418
 
388
419
  // src/hooks/useProfiles.tsx
389
420
  var import_jsx_runtime9 = require("react/jsx-runtime");
390
421
  var SHARED_GROUP_ID = "group.com.infinitetoken.tastic";
391
- var ProfilesContext = (0, import_react7.createContext)(null);
422
+ var ProfilesContext = (0, import_react8.createContext)(null);
392
423
  function ProfilesProvider({ children }) {
393
- const profiles = (0, import_react_redux5.useSelector)((state) => state.profiles);
394
- const lastSelected = (0, import_react_redux5.useSelector)((state) => state.profileSelection);
395
- const dispatch = (0, import_react_redux5.useDispatch)();
396
- const [loaded, setLoaded] = (0, import_react7.useState)(false);
397
- (0, import_react7.useEffect)(() => {
424
+ const profiles = (0, import_react_redux6.useSelector)((state) => state.profiles);
425
+ const lastSelected = (0, import_react_redux6.useSelector)((state) => state.profileSelection);
426
+ const dispatch = (0, import_react_redux6.useDispatch)();
427
+ const [loaded, setLoaded] = (0, import_react8.useState)(false);
428
+ (0, import_react8.useEffect)(() => {
398
429
  let cancelled = false;
399
430
  (0, import_profile2.resolveInitialProfiles)(SHARED_GROUP_ID, profiles).then((resolved) => {
400
431
  if (cancelled) return;
@@ -408,7 +439,7 @@ function ProfilesProvider({ children }) {
408
439
  }, []);
409
440
  const { syncToShared } = (0, import_profile2.useSharedProfilesSync)({
410
441
  groupId: SHARED_GROUP_ID,
411
- onRemoteChange: (0, import_react7.useCallback)(
442
+ onRemoteChange: (0, import_react8.useCallback)(
412
443
  (remote) => {
413
444
  dispatch(import_profile2.profilesActions.setAll(remote));
414
445
  dispatch(profileSelectionActions.pruneToRoster(remote.map((p) => p.id)));
@@ -416,7 +447,7 @@ function ProfilesProvider({ children }) {
416
447
  [dispatch]
417
448
  )
418
449
  });
419
- const createProfile = (0, import_react7.useCallback)(
450
+ const createProfile = (0, import_react8.useCallback)(
420
451
  (input) => {
421
452
  const record = (0, import_profile2.createProfileRecord)(input);
422
453
  dispatch(import_profile2.profilesActions.add(record));
@@ -425,14 +456,14 @@ function ProfilesProvider({ children }) {
425
456
  },
426
457
  [profiles, dispatch, syncToShared]
427
458
  );
428
- const updateProfile = (0, import_react7.useCallback)(
459
+ const updateProfile = (0, import_react8.useCallback)(
429
460
  (id, patch) => {
430
461
  dispatch(import_profile2.profilesActions.update({ id, patch }));
431
462
  syncToShared(profiles.map((p) => p.id === id ? { ...p, ...patch, updatedAt: Date.now() } : p));
432
463
  },
433
464
  [profiles, dispatch, syncToShared]
434
465
  );
435
- const deleteProfile = (0, import_react7.useCallback)(
466
+ const deleteProfile = (0, import_react8.useCallback)(
436
467
  (id) => {
437
468
  dispatch(import_profile2.profilesActions.remove(id));
438
469
  syncToShared(profiles.filter((p) => p.id !== id));
@@ -440,7 +471,7 @@ function ProfilesProvider({ children }) {
440
471
  },
441
472
  [profiles, dispatch, syncToShared]
442
473
  );
443
- const selectProfile = (0, import_react7.useCallback)(
474
+ const selectProfile = (0, import_react8.useCallback)(
444
475
  (seat, profileId) => {
445
476
  dispatch(profileSelectionActions.select({ profileId, seat }));
446
477
  },
@@ -449,7 +480,7 @@ function ProfilesProvider({ children }) {
449
480
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ProfilesContext.Provider, { value: { profiles, lastSelected, loaded, createProfile, updateProfile, deleteProfile, selectProfile }, children });
450
481
  }
451
482
  function useProfiles() {
452
- const ctx = (0, import_react7.useContext)(ProfilesContext);
483
+ const ctx = (0, import_react8.useContext)(ProfilesContext);
453
484
  if (!ctx) throw new Error("useProfiles must be used within a ProfilesProvider");
454
485
  return ctx;
455
486
  }
@@ -465,19 +496,23 @@ function AppStack() {
465
496
  const { Backdrop } = pack;
466
497
  const { dark } = (0, import_auto_paper2.useAutoPaperTheme)();
467
498
  const darkRoot = Backdrop ? true : dark;
468
- const rootBackground = (0, import_core4.useThemedRootBackground)(darkRoot, false);
499
+ const rootBackground = (0, import_core5.useThemedRootBackground)(darkRoot, false);
469
500
  const statusBarStyle = darkRoot ? "light" : "dark";
470
501
  const packOptions = (pack.useScreenOptions ?? noScreenOptions)();
471
502
  const backdropOptions = Backdrop ? { contentStyle: TRANSPARENT_CONTENT, animation: import_react_native3.Platform.select({ android: "fade" }) } : void 0;
472
- const playOptions = (0, import_react8.useCallback)(
503
+ const { edgeGuard = true } = pack;
504
+ const { deferBottomEdgeGestures } = useAppSettings().settings;
505
+ const edgeGuardOptions = (0, import_react9.useMemo)(() => (0, import_edge_guard2.edgeGuardScreenOptions)(edgeGuard && deferBottomEdgeGestures), [edgeGuard, deferBottomEdgeGestures]);
506
+ const playOptions = (0, import_react9.useCallback)(
473
507
  ({ route }) => {
474
508
  const id = route.params?.game;
475
- return pack.games.some((g) => g.id === id && g.keepStatusBar) ? KEEP_STATUS_BAR_OPTIONS : PLAY_OPTIONS;
509
+ const statusBarOptions = pack.games.some((g) => g.id === id && g.keepStatusBar) ? KEEP_STATUS_BAR_OPTIONS : PLAY_OPTIONS;
510
+ return { ...statusBarOptions, ...edgeGuardOptions };
476
511
  },
477
- [pack.games]
512
+ [pack.games, edgeGuardOptions]
478
513
  );
479
514
  const navigationBackground = Backdrop ? TRANSPARENT_CONTENT.backgroundColor : rootBackground.contentStyle.backgroundColor;
480
- const navigationTheme = (0, import_react8.useMemo)(() => {
515
+ const navigationTheme = (0, import_react9.useMemo)(() => {
481
516
  const base = darkRoot ? import_expo_router.DarkTheme : import_expo_router.DefaultTheme;
482
517
  return { ...base, colors: { ...base.colors, background: navigationBackground } };
483
518
  }, [darkRoot, navigationBackground]);
@@ -500,22 +535,19 @@ function HapticGatedToastProvider({ children }) {
500
535
  const { Toaster: PackToasterComponent } = usePack();
501
536
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_toaster2.ToastProvider, { haptics: settings.vibrate ? Haptics : void 0, paper: PackToasterComponent ? void 0 : RNPaper2, children });
502
537
  }
503
- function RotatingToaster() {
504
- const renderFrame = (0, import_react8.useCallback)(
505
- (toasts) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_chrome2.RotatedFrame, { rotatedSafeArea: true, passThrough: true, children: toasts }),
506
- []
507
- );
538
+ function FramedToaster() {
539
+ const renderFrame = (0, import_react9.useCallback)((toasts) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_chrome2.ScreenFrame, { passThrough: true, children: toasts }), []);
508
540
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_toaster2.Toaster, { historyButton: null, clearButton: null, limit: 3, renderFrame });
509
541
  }
510
542
  function PackToaster({ Toaster: PackToasterComponent }) {
511
- 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, {}) }) });
543
+ 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, {}) }) });
512
544
  }
513
545
  function GameProviders({ games, children }) {
514
546
  return games.reduceRight((inner, game) => game.Provider ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(game.Provider, { children: inner }, game.id) : inner, children);
515
547
  }
516
548
  function PreviewColors({ previewColor, children }) {
517
549
  const { dark } = (0, import_auto_paper2.useAutoPaperTheme)();
518
- const preview = (0, import_react8.useCallback)((hex) => previewColor(hex, dark), [previewColor, dark]);
550
+ const preview = (0, import_react9.useCallback)((hex) => previewColor(hex, dark), [previewColor, dark]);
519
551
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_profile3.ProfileColorProvider, { preview, children });
520
552
  }
521
553
  function PackRoot({ pack, children }) {
@@ -526,7 +558,7 @@ function PackRoot({ pack, children }) {
526
558
  function RootLayout({ pack, store, persistor }) {
527
559
  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: [
528
560
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(GuideHost, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AppStack, {}) }),
529
- pack.Toaster ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PackToaster, { Toaster: pack.Toaster }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RotatingToaster, {}),
561
+ pack.Toaster ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PackToaster, { Toaster: pack.Toaster }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FramedToaster, {}),
530
562
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(UpdateDialog, {})
531
563
  ] }) }) }) }) }) }) }) }) }) }) }) }) });
532
564
  }
@@ -561,7 +593,7 @@ var import_react_redux9 = require("react-redux");
561
593
  // src/components/OpponentPicker.tsx
562
594
  var import_lobby = require("@tastic/hud/lobby");
563
595
  var import_profile4 = require("@tastic/profile");
564
- var import_react9 = require("react");
596
+ var import_react10 = require("react");
565
597
  var import_react_native4 = require("react-native");
566
598
  var import_jsx_runtime11 = require("react/jsx-runtime");
567
599
  var CPU_PREFIX = "cpu:";
@@ -576,7 +608,7 @@ function getOpponentPopoverId(idPrefix) {
576
608
  function OpponentPicker({ idPrefix, host, choices, seatTwo, onSeatTwoChange, cpuDifficulty, color, onColorChange, swatches, takenColor, allowSwapTaken, dark, previewValue, triggerStyle, usePickerAlign }) {
577
609
  const drawn = previewValue ? previewValue(color) : color;
578
610
  const cpuOptions = cpuDifficulty?.options;
579
- const options = (0, import_react9.useMemo)(() => {
611
+ const options = (0, import_react10.useMemo)(() => {
580
612
  const list = [];
581
613
  if (choices.includes("cpu")) list.push(...cpuOptions ? cpuOptions.map((o) => ({ value: `${CPU_PREFIX}${o.value}`, label: o.label, icon: o.icon })) : [{ value: CPU_PREFIX, label: "CPU", icon: CPU_ICON }]);
582
614
  if (choices.includes("nobody")) list.push({ value: NOBODY, label: "Solo", icon: NOBODY_ICON, dividerBefore: true });
@@ -614,38 +646,6 @@ var styles2 = import_react_native4.StyleSheet.create({
614
646
  // src/components/SettingsDialog.tsx
615
647
  var import_toaster3 = require("@rific/toaster");
616
648
  var import_chrome3 = require("@tastic/hud/chrome");
617
-
618
- // src/hooks/useAppSettings.ts
619
- var import_react10 = require("react");
620
- var import_react_redux6 = require("react-redux");
621
-
622
- // src/redux/appSettingsSlice.ts
623
- var import_core5 = require("@rific/core");
624
- var DEFAULT_APP_SETTINGS = {
625
- deferBottomEdgeGestures: false
626
- };
627
- var { actions: actions3, reducer: reducer3 } = (0, import_core5.createSettingsSlice)("appSettings", {
628
- initialState: DEFAULT_APP_SETTINGS,
629
- initializeMode: "merge",
630
- fieldSetters: []
631
- });
632
- var appSettingsActions = actions3;
633
- var appSettingsSlice_default = reducer3;
634
-
635
- // src/hooks/useAppSettings.ts
636
- function useAppSettings() {
637
- const settings = (0, import_react_redux6.useSelector)((state) => state.appSettings);
638
- const dispatch = (0, import_react_redux6.useDispatch)();
639
- const setSettings = (0, import_react10.useCallback)(
640
- (patch) => {
641
- dispatch(appSettingsActions.initialize(patch));
642
- },
643
- [dispatch]
644
- );
645
- return { settings, setSettings };
646
- }
647
-
648
- // src/components/SettingsDialog.tsx
649
649
  var import_jsx_runtime12 = require("react/jsx-runtime");
650
650
  var noSettingsRules = () => null;
651
651
  function SettingsDialog({ visible, onDismiss, onShowHowToPlay, children }) {
@@ -1469,7 +1469,7 @@ function useRosterAlign(open, contentWidth, contentHeight) {
1469
1469
  function ProfilesRoute() {
1470
1470
  const { profiles, createProfile, updateProfile, deleteProfile } = useProfiles();
1471
1471
  const { Backdrop, foreground, newProfileColor, usePickerAlign } = usePack();
1472
- 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 }) });
1472
+ 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 }) });
1473
1473
  }
1474
1474
 
1475
1475
  // src/screens/StatsScreen.tsx
@@ -1497,7 +1497,7 @@ var GAME_PICKER_ID = "stats-game";
1497
1497
  var STATS_MAX_WIDTH = 640;
1498
1498
  function StatsScreen() {
1499
1499
  const pickerHost = (0, import_chrome7.usePopoverHost)();
1500
- 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 }) }) });
1500
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(StatsPressAway, { host: pickerHost, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_chrome7.ScreenFrame, { portalHost: true, maxContentWidth: STATS_MAX_WIDTH, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(StatsContent, { pickerHost }) }) });
1501
1501
  }
1502
1502
  function StatsPressAway({ host, children }) {
1503
1503
  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 });
@@ -1534,7 +1534,7 @@ function StatsContent({ pickerHost }) {
1534
1534
  const surface = pack.Backdrop ? { backgroundColor: colors.surface } : void 0;
1535
1535
  const triggerStyle = pack.Backdrop ? [styles5.pill, surface] : void 0;
1536
1536
  const PackTabContent = packTab?.Content;
1537
- 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: [
1537
+ 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, children: [
1538
1538
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_chrome7.PressAwayOverlay, { active: pickerHost.openId !== null, onPress: pickerHost.close, style: styles5.pressAway }),
1539
1539
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native_paper2.SegmentedButtons, { value: tab, onValueChange: setTab, buttons: tabButtons, theme: SEGMENT_THEME, style: [styles5.tabs, surface] }),
1540
1540
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native10.View, { style: [styles5.filters, pickerHost.openId !== null && styles5.filtersOpen], onStartShouldSetResponder: () => pickerHost.openId !== null, children: [
@@ -1656,9 +1656,13 @@ function useActiveRound(game, defaults) {
1656
1656
  // src/hooks/useBackBlock.ts
1657
1657
  var import_expo_router7 = require("expo-router");
1658
1658
  var import_react19 = require("react");
1659
- function useBackBlock(held, onHeld) {
1659
+ function useBackBlock(held, onHeld, leave = import_core8.safeBack) {
1660
1660
  const leavingRef = (0, import_react19.useRef)(false);
1661
1661
  const [leaving, setLeaving] = (0, import_react19.useState)(false);
1662
+ const leaveRef = (0, import_react19.useRef)(leave);
1663
+ (0, import_react19.useEffect)(() => {
1664
+ leaveRef.current = leave;
1665
+ });
1662
1666
  (0, import_expo_router7.usePreventRemove)(held && !leaving, ({ repeat }) => {
1663
1667
  if (leavingRef.current) {
1664
1668
  setLeaving(true);
@@ -1667,7 +1671,7 @@ function useBackBlock(held, onHeld) {
1667
1671
  });
1668
1672
  return (0, import_react19.useCallback)(() => {
1669
1673
  leavingRef.current = true;
1670
- (0, import_core8.safeBack)();
1674
+ leaveRef.current();
1671
1675
  }, []);
1672
1676
  }
1673
1677
 
@@ -1681,8 +1685,6 @@ var import_auto_paper9 = require("@rific/auto-paper");
1681
1685
  var import_core12 = require("@rific/core");
1682
1686
  var import_feedback_press5 = require("@rific/feedback-press");
1683
1687
  var import_profile10 = require("@tastic/profile");
1684
- var initialSoundSettings = { ...import_feedback_press5.defaultSoundSettings, enabled: !__DEV__ };
1685
- var appSoundReducer = (state = initialSoundSettings, action) => (0, import_feedback_press5.soundReducer)(state, action);
1686
1688
  function createShellReducers({ seatColors, appearance = "system", seatTheme }) {
1687
1689
  return {
1688
1690
  // Explicit primary/secondary triad (rather than a single seed expanded via harmony) so the pack's
@@ -1696,7 +1698,9 @@ function createShellReducers({ seatColors, appearance = "system", seatTheme }) {
1696
1698
  // only when the pack's appearance is; hooks/useSeatColors.ts re-applies it with the live mode).
1697
1699
  theme: (0, import_auto_paper9.createThemeReducer)(seatTheme ? { appearance, ...seatTheme(seatColors, appearance === "dark") } : { appearance, color: { primary: seatColors[1], secondary: seatColors[2], tertiary: (0, import_auto_paper9.getThirdColor)(seatColors[1], seatColors[2]) } }),
1698
1700
  haptic: import_feedback_press5.hapticReducer,
1699
- sound: appSoundReducer,
1701
+ // Starts off in a development build (feedback-press's defaultSoundSettings is `!__DEV__`), so local
1702
+ // testing on a simulator is silent; a production build starts with sound on.
1703
+ sound: import_feedback_press5.soundReducer,
1700
1704
  // @rific/core's Keep Awake setting (see Providers.tsx's KeepAwakeBridge), under the namespace its
1701
1705
  // REHYDRATE handling expects.
1702
1706
  keepAwake: import_core12.keepAwakeReducer,
@@ -1717,11 +1721,6 @@ function createShellReducers({ seatColors, appearance = "system", seatTheme }) {
1717
1721
  }
1718
1722
 
1719
1723
  // src/redux/createPackStore.ts
1720
- var hasError = (action) => typeof action === "object" && action !== null && "error" in action && Boolean(action.error);
1721
- var errorMiddleware = () => (next) => (action) => {
1722
- if (!hasError(action)) return next(action);
1723
- return action;
1724
- };
1725
1724
  function createPackStore(pack, { keyPrefix, migrate, blacklist = [], serializableIgnoredPaths = [], middleware = [] }) {
1726
1725
  const gameReducers = Object.assign({}, ...pack.games.map((game) => game.reducers));
1727
1726
  const resumeReducers = pack.games.some((game) => game.resumable) ? { lastActiveGame: lastActiveGameSlice_default } : {};
@@ -1754,7 +1753,7 @@ function createPackStore(pack, { keyPrefix, migrate, blacklist = [], serializabl
1754
1753
  ignoredPaths: [...serializableIgnoredPaths]
1755
1754
  }
1756
1755
  });
1757
- return defaultMiddleware.concat(errorMiddleware, ...middleware);
1756
+ return defaultMiddleware.concat(...middleware);
1758
1757
  },
1759
1758
  reducer: persistedReducer
1760
1759
  });