@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/README.md +147 -21
- package/dist/index.d.mts +2 -7
- package/dist/index.d.ts +2 -7
- package/dist/index.js +92 -93
- package/dist/index.mjs +81 -82
- package/package.json +10 -9
- package/src/RootLayout.tsx +24 -19
- package/src/hooks/useAppSettings.ts +1 -1
- package/src/hooks/useBackBlock.ts +12 -3
- package/src/redux/createPackStore.ts +1 -8
- package/src/redux/shellState.ts +4 -10
- package/src/screens/ProfilesRoute.tsx +6 -7
- package/src/screens/StatsScreen.tsx +6 -7
- package/src/types.ts +2 -1
package/dist/index.mjs
CHANGED
|
@@ -26,11 +26,12 @@ import { useAutoPaperTheme } from "@rific/auto-paper";
|
|
|
26
26
|
import { useHapticSettings } from "@rific/feedback-press";
|
|
27
27
|
import { Toaster, ToastProvider } from "@rific/toaster";
|
|
28
28
|
import { useThemedRootBackground } from "@tastic/core";
|
|
29
|
-
import {
|
|
29
|
+
import { edgeGuardScreenOptions } from "@tastic/edge-guard";
|
|
30
|
+
import { ScreenFrame } from "@tastic/hud/chrome";
|
|
30
31
|
import { ProfileColorProvider } from "@tastic/profile";
|
|
31
32
|
import * as Haptics from "expo-haptics";
|
|
32
33
|
import { DarkTheme, DefaultTheme, Stack, ThemeProvider as NavigationThemeProvider } from "expo-router";
|
|
33
|
-
import { useCallback as
|
|
34
|
+
import { useCallback as useCallback6, useMemo as useMemo3 } from "react";
|
|
34
35
|
import { Platform as Platform3, StyleSheet, View } from "react-native";
|
|
35
36
|
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
36
37
|
import * as RNPaper2 from "react-native-paper";
|
|
@@ -243,22 +244,52 @@ function WindowControlsInsets({ children }) {
|
|
|
243
244
|
return /* @__PURE__ */ jsx7(SafeAreaInsetsContext.Provider, { value: vertical, children });
|
|
244
245
|
}
|
|
245
246
|
|
|
247
|
+
// src/hooks/useAppSettings.ts
|
|
248
|
+
import { useCallback as useCallback4 } from "react";
|
|
249
|
+
import { useDispatch as useDispatch4, useSelector as useSelector4 } from "react-redux";
|
|
250
|
+
|
|
251
|
+
// src/redux/appSettingsSlice.ts
|
|
252
|
+
import { createSettingsSlice } from "@rific/core";
|
|
253
|
+
var DEFAULT_APP_SETTINGS = {
|
|
254
|
+
deferBottomEdgeGestures: false
|
|
255
|
+
};
|
|
256
|
+
var { actions, reducer } = createSettingsSlice("appSettings", {
|
|
257
|
+
initialState: DEFAULT_APP_SETTINGS,
|
|
258
|
+
initializeMode: "merge",
|
|
259
|
+
fieldSetters: []
|
|
260
|
+
});
|
|
261
|
+
var appSettingsActions = actions;
|
|
262
|
+
var appSettingsSlice_default = reducer;
|
|
263
|
+
|
|
264
|
+
// src/hooks/useAppSettings.ts
|
|
265
|
+
function useAppSettings() {
|
|
266
|
+
const settings = useSelector4((state) => state.appSettings);
|
|
267
|
+
const dispatch = useDispatch4();
|
|
268
|
+
const setSettings = useCallback4(
|
|
269
|
+
(patch) => {
|
|
270
|
+
dispatch(appSettingsActions.initialize(patch));
|
|
271
|
+
},
|
|
272
|
+
[dispatch]
|
|
273
|
+
);
|
|
274
|
+
return { settings, setSettings };
|
|
275
|
+
}
|
|
276
|
+
|
|
246
277
|
// src/hooks/useLastActiveGame.tsx
|
|
247
278
|
import { createContext as createContext3, useContext as useContext3, useMemo as useMemo2, useRef as useRef2, useState as useState2 } from "react";
|
|
248
|
-
import { useDispatch as
|
|
279
|
+
import { useDispatch as useDispatch5, useStore as useStore2 } from "react-redux";
|
|
249
280
|
|
|
250
281
|
// src/redux/lastActiveGameSlice.ts
|
|
251
|
-
import { createSettingsSlice } from "@rific/core";
|
|
252
|
-
var { actions, reducer } =
|
|
253
|
-
var lastActiveGameActions =
|
|
254
|
-
var lastActiveGameSlice_default =
|
|
282
|
+
import { createSettingsSlice as createSettingsSlice2 } from "@rific/core";
|
|
283
|
+
var { actions: actions2, reducer: reducer2 } = createSettingsSlice2("lastActiveGame", { initialState: { gameId: null } });
|
|
284
|
+
var lastActiveGameActions = actions2;
|
|
285
|
+
var lastActiveGameSlice_default = reducer2;
|
|
255
286
|
|
|
256
287
|
// src/hooks/useLastActiveGame.tsx
|
|
257
288
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
258
289
|
var LastActiveGameContext = createContext3(null);
|
|
259
290
|
function LastActiveGameProvider({ children }) {
|
|
260
291
|
const store = useStore2();
|
|
261
|
-
const dispatch =
|
|
292
|
+
const dispatch = useDispatch5();
|
|
262
293
|
const [initial] = useState2(() => store.getState().lastActiveGame?.gameId ?? null);
|
|
263
294
|
const pendingResume = useRef2(initial);
|
|
264
295
|
const persisted = useRef2(initial);
|
|
@@ -297,24 +328,24 @@ function useLastActiveGame() {
|
|
|
297
328
|
|
|
298
329
|
// src/hooks/useProfiles.tsx
|
|
299
330
|
import { createProfileRecord, profilesActions, resolveInitialProfiles, useSharedProfilesSync } from "@tastic/profile";
|
|
300
|
-
import { createContext as createContext4, useCallback as
|
|
301
|
-
import { useDispatch as
|
|
331
|
+
import { createContext as createContext4, useCallback as useCallback5, useContext as useContext4, useEffect as useEffect2, useState as useState3 } from "react";
|
|
332
|
+
import { useDispatch as useDispatch6, useSelector as useSelector5 } from "react-redux";
|
|
302
333
|
|
|
303
334
|
// src/redux/profileSelectionSlice.ts
|
|
304
335
|
import { createProfileSelectionSlice } from "@tastic/profile";
|
|
305
336
|
var defaultProfileSelectionState = { 1: null, 2: null };
|
|
306
|
-
var { actions:
|
|
307
|
-
var profileSelectionActions =
|
|
308
|
-
var profileSelectionSlice_default =
|
|
337
|
+
var { actions: actions3, reducer: reducer3 } = createProfileSelectionSlice("pack", defaultProfileSelectionState);
|
|
338
|
+
var profileSelectionActions = actions3;
|
|
339
|
+
var profileSelectionSlice_default = reducer3;
|
|
309
340
|
|
|
310
341
|
// src/hooks/useProfiles.tsx
|
|
311
342
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
312
343
|
var SHARED_GROUP_ID = "group.com.infinitetoken.tastic";
|
|
313
344
|
var ProfilesContext = createContext4(null);
|
|
314
345
|
function ProfilesProvider({ children }) {
|
|
315
|
-
const profiles =
|
|
316
|
-
const lastSelected =
|
|
317
|
-
const dispatch =
|
|
346
|
+
const profiles = useSelector5((state) => state.profiles);
|
|
347
|
+
const lastSelected = useSelector5((state) => state.profileSelection);
|
|
348
|
+
const dispatch = useDispatch6();
|
|
318
349
|
const [loaded, setLoaded] = useState3(false);
|
|
319
350
|
useEffect2(() => {
|
|
320
351
|
let cancelled = false;
|
|
@@ -330,7 +361,7 @@ function ProfilesProvider({ children }) {
|
|
|
330
361
|
}, []);
|
|
331
362
|
const { syncToShared } = useSharedProfilesSync({
|
|
332
363
|
groupId: SHARED_GROUP_ID,
|
|
333
|
-
onRemoteChange:
|
|
364
|
+
onRemoteChange: useCallback5(
|
|
334
365
|
(remote) => {
|
|
335
366
|
dispatch(profilesActions.setAll(remote));
|
|
336
367
|
dispatch(profileSelectionActions.pruneToRoster(remote.map((p) => p.id)));
|
|
@@ -338,7 +369,7 @@ function ProfilesProvider({ children }) {
|
|
|
338
369
|
[dispatch]
|
|
339
370
|
)
|
|
340
371
|
});
|
|
341
|
-
const createProfile =
|
|
372
|
+
const createProfile = useCallback5(
|
|
342
373
|
(input) => {
|
|
343
374
|
const record = createProfileRecord(input);
|
|
344
375
|
dispatch(profilesActions.add(record));
|
|
@@ -347,14 +378,14 @@ function ProfilesProvider({ children }) {
|
|
|
347
378
|
},
|
|
348
379
|
[profiles, dispatch, syncToShared]
|
|
349
380
|
);
|
|
350
|
-
const updateProfile =
|
|
381
|
+
const updateProfile = useCallback5(
|
|
351
382
|
(id, patch) => {
|
|
352
383
|
dispatch(profilesActions.update({ id, patch }));
|
|
353
384
|
syncToShared(profiles.map((p) => p.id === id ? { ...p, ...patch, updatedAt: Date.now() } : p));
|
|
354
385
|
},
|
|
355
386
|
[profiles, dispatch, syncToShared]
|
|
356
387
|
);
|
|
357
|
-
const deleteProfile =
|
|
388
|
+
const deleteProfile = useCallback5(
|
|
358
389
|
(id) => {
|
|
359
390
|
dispatch(profilesActions.remove(id));
|
|
360
391
|
syncToShared(profiles.filter((p) => p.id !== id));
|
|
@@ -362,7 +393,7 @@ function ProfilesProvider({ children }) {
|
|
|
362
393
|
},
|
|
363
394
|
[profiles, dispatch, syncToShared]
|
|
364
395
|
);
|
|
365
|
-
const selectProfile =
|
|
396
|
+
const selectProfile = useCallback5(
|
|
366
397
|
(seat, profileId) => {
|
|
367
398
|
dispatch(profileSelectionActions.select({ profileId, seat }));
|
|
368
399
|
},
|
|
@@ -391,12 +422,16 @@ function AppStack() {
|
|
|
391
422
|
const statusBarStyle = darkRoot ? "light" : "dark";
|
|
392
423
|
const packOptions = (pack.useScreenOptions ?? noScreenOptions)();
|
|
393
424
|
const backdropOptions = Backdrop ? { contentStyle: TRANSPARENT_CONTENT, animation: Platform3.select({ android: "fade" }) } : void 0;
|
|
394
|
-
const
|
|
425
|
+
const { edgeGuard = true } = pack;
|
|
426
|
+
const { deferBottomEdgeGestures } = useAppSettings().settings;
|
|
427
|
+
const edgeGuardOptions = useMemo3(() => edgeGuardScreenOptions(edgeGuard && deferBottomEdgeGestures), [edgeGuard, deferBottomEdgeGestures]);
|
|
428
|
+
const playOptions = useCallback6(
|
|
395
429
|
({ route }) => {
|
|
396
430
|
const id = route.params?.game;
|
|
397
|
-
|
|
431
|
+
const statusBarOptions = pack.games.some((g) => g.id === id && g.keepStatusBar) ? KEEP_STATUS_BAR_OPTIONS : PLAY_OPTIONS;
|
|
432
|
+
return { ...statusBarOptions, ...edgeGuardOptions };
|
|
398
433
|
},
|
|
399
|
-
[pack.games]
|
|
434
|
+
[pack.games, edgeGuardOptions]
|
|
400
435
|
);
|
|
401
436
|
const navigationBackground = Backdrop ? TRANSPARENT_CONTENT.backgroundColor : rootBackground.contentStyle.backgroundColor;
|
|
402
437
|
const navigationTheme = useMemo3(() => {
|
|
@@ -422,22 +457,19 @@ function HapticGatedToastProvider({ children }) {
|
|
|
422
457
|
const { Toaster: PackToasterComponent } = usePack();
|
|
423
458
|
return /* @__PURE__ */ jsx10(ToastProvider, { haptics: settings.vibrate ? Haptics : void 0, paper: PackToasterComponent ? void 0 : RNPaper2, children });
|
|
424
459
|
}
|
|
425
|
-
function
|
|
426
|
-
const renderFrame =
|
|
427
|
-
(toasts) => /* @__PURE__ */ jsx10(RotatedFrame, { rotatedSafeArea: true, passThrough: true, children: toasts }),
|
|
428
|
-
[]
|
|
429
|
-
);
|
|
460
|
+
function FramedToaster() {
|
|
461
|
+
const renderFrame = useCallback6((toasts) => /* @__PURE__ */ jsx10(ScreenFrame, { passThrough: true, children: toasts }), []);
|
|
430
462
|
return /* @__PURE__ */ jsx10(Toaster, { historyButton: null, clearButton: null, limit: 3, renderFrame });
|
|
431
463
|
}
|
|
432
464
|
function PackToaster({ Toaster: PackToasterComponent }) {
|
|
433
|
-
return /* @__PURE__ */ jsx10(View, { style: StyleSheet.absoluteFill, pointerEvents: "box-none", children: /* @__PURE__ */ jsx10(
|
|
465
|
+
return /* @__PURE__ */ jsx10(View, { style: StyleSheet.absoluteFill, pointerEvents: "box-none", children: /* @__PURE__ */ jsx10(ScreenFrame, { passThrough: true, children: /* @__PURE__ */ jsx10(PackToasterComponent, {}) }) });
|
|
434
466
|
}
|
|
435
467
|
function GameProviders({ games, children }) {
|
|
436
468
|
return games.reduceRight((inner, game) => game.Provider ? /* @__PURE__ */ jsx10(game.Provider, { children: inner }, game.id) : inner, children);
|
|
437
469
|
}
|
|
438
470
|
function PreviewColors({ previewColor, children }) {
|
|
439
471
|
const { dark } = useAutoPaperTheme();
|
|
440
|
-
const preview =
|
|
472
|
+
const preview = useCallback6((hex) => previewColor(hex, dark), [previewColor, dark]);
|
|
441
473
|
return /* @__PURE__ */ jsx10(ProfileColorProvider, { preview, children });
|
|
442
474
|
}
|
|
443
475
|
function PackRoot({ pack, children }) {
|
|
@@ -448,7 +480,7 @@ function PackRoot({ pack, children }) {
|
|
|
448
480
|
function RootLayout({ pack, store, persistor }) {
|
|
449
481
|
return /* @__PURE__ */ jsx10(GestureHandlerRootView, { style: styles.root, children: /* @__PURE__ */ jsx10(SafeAreaProvider, { children: /* @__PURE__ */ jsx10(WindowControlsInsets, { children: /* @__PURE__ */ jsx10(PackProvider, { pack, children: /* @__PURE__ */ jsx10(Fonts, { children: /* @__PURE__ */ jsx10(Providers, { store, persistor, children: /* @__PURE__ */ jsx10(Theme, { children: /* @__PURE__ */ jsx10(ProfilesProvider, { children: /* @__PURE__ */ jsx10(LastActiveGameProvider, { children: /* @__PURE__ */ jsx10(GameProviders, { games: pack.games, children: /* @__PURE__ */ jsx10(PackRoot, { pack, children: /* @__PURE__ */ jsx10(GatedApp, { children: /* @__PURE__ */ jsxs2(HapticGatedToastProvider, { children: [
|
|
450
482
|
/* @__PURE__ */ jsx10(GuideHost, { children: /* @__PURE__ */ jsx10(AppStack, {}) }),
|
|
451
|
-
pack.Toaster ? /* @__PURE__ */ jsx10(PackToaster, { Toaster: pack.Toaster }) : /* @__PURE__ */ jsx10(
|
|
483
|
+
pack.Toaster ? /* @__PURE__ */ jsx10(PackToaster, { Toaster: pack.Toaster }) : /* @__PURE__ */ jsx10(FramedToaster, {}),
|
|
452
484
|
/* @__PURE__ */ jsx10(UpdateDialog, {})
|
|
453
485
|
] }) }) }) }) }) }) }) }) }) }) }) }) });
|
|
454
486
|
}
|
|
@@ -536,38 +568,6 @@ var styles2 = StyleSheet2.create({
|
|
|
536
568
|
// src/components/SettingsDialog.tsx
|
|
537
569
|
import { useUpdateErrorToast as useUpdateErrorToast2 } from "@rific/toaster";
|
|
538
570
|
import { BaseSettingsDialog } from "@tastic/hud/chrome";
|
|
539
|
-
|
|
540
|
-
// src/hooks/useAppSettings.ts
|
|
541
|
-
import { useCallback as useCallback6 } from "react";
|
|
542
|
-
import { useDispatch as useDispatch6, useSelector as useSelector5 } from "react-redux";
|
|
543
|
-
|
|
544
|
-
// src/redux/appSettingsSlice.ts
|
|
545
|
-
import { createSettingsSlice as createSettingsSlice2 } from "@rific/core";
|
|
546
|
-
var DEFAULT_APP_SETTINGS = {
|
|
547
|
-
deferBottomEdgeGestures: false
|
|
548
|
-
};
|
|
549
|
-
var { actions: actions3, reducer: reducer3 } = createSettingsSlice2("appSettings", {
|
|
550
|
-
initialState: DEFAULT_APP_SETTINGS,
|
|
551
|
-
initializeMode: "merge",
|
|
552
|
-
fieldSetters: []
|
|
553
|
-
});
|
|
554
|
-
var appSettingsActions = actions3;
|
|
555
|
-
var appSettingsSlice_default = reducer3;
|
|
556
|
-
|
|
557
|
-
// src/hooks/useAppSettings.ts
|
|
558
|
-
function useAppSettings() {
|
|
559
|
-
const settings = useSelector5((state) => state.appSettings);
|
|
560
|
-
const dispatch = useDispatch6();
|
|
561
|
-
const setSettings = useCallback6(
|
|
562
|
-
(patch) => {
|
|
563
|
-
dispatch(appSettingsActions.initialize(patch));
|
|
564
|
-
},
|
|
565
|
-
[dispatch]
|
|
566
|
-
);
|
|
567
|
-
return { settings, setSettings };
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
// src/components/SettingsDialog.tsx
|
|
571
571
|
import { jsx as jsx12, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
572
572
|
var noSettingsRules = () => null;
|
|
573
573
|
function SettingsDialog({ visible, onDismiss, onShowHowToPlay, children }) {
|
|
@@ -1380,7 +1380,7 @@ var styles4 = StyleSheet4.create({
|
|
|
1380
1380
|
|
|
1381
1381
|
// src/screens/ProfilesRoute.tsx
|
|
1382
1382
|
import { defaultColors as defaultColors3 } from "@rific/auto-paper";
|
|
1383
|
-
import {
|
|
1383
|
+
import { ScreenFrame as ScreenFrame2 } from "@tastic/hud/chrome";
|
|
1384
1384
|
import { ProfilesScreen } from "@tastic/profile";
|
|
1385
1385
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1386
1386
|
var ROSTER_MAX_WIDTH = 640;
|
|
@@ -1391,12 +1391,12 @@ function useRosterAlign(open, contentWidth, contentHeight) {
|
|
|
1391
1391
|
function ProfilesRoute() {
|
|
1392
1392
|
const { profiles, createProfile, updateProfile, deleteProfile } = useProfiles();
|
|
1393
1393
|
const { Backdrop, foreground, newProfileColor, usePickerAlign } = usePack();
|
|
1394
|
-
return /* @__PURE__ */ jsx16(
|
|
1394
|
+
return /* @__PURE__ */ jsx16(ScreenFrame2, { portalHost: true, maxContentWidth: ROSTER_MAX_WIDTH, children: /* @__PURE__ */ jsx16(ProfilesScreen, { profiles, defaultColor: newProfileColor ?? defaultColors3[0].value, onCreate: (patch) => createProfile(patch), onSave: (id, patch) => updateProfile(id, patch), onDelete: deleteProfile, onBack: safeBack, fg: foreground, bg: Backdrop ? "transparent" : void 0, useColorPickerAlign: usePickerAlign ? useRosterAlign : void 0 }) });
|
|
1395
1395
|
}
|
|
1396
1396
|
|
|
1397
1397
|
// src/screens/StatsScreen.tsx
|
|
1398
1398
|
import { useAutoPaperTheme as useAutoPaperTheme5 } from "@rific/auto-paper";
|
|
1399
|
-
import { BaseStatsScreen, PressAwayOverlay as PressAwayOverlay3,
|
|
1399
|
+
import { BaseStatsScreen, PressAwayOverlay as PressAwayOverlay3, ScreenFrame as ScreenFrame3, usePopoverHost as usePopoverHost3 } from "@tastic/hud/chrome";
|
|
1400
1400
|
import { getOptionPickerContentSize as getOptionPickerContentSize2, OptionPicker as OptionPicker2 } from "@tastic/profile";
|
|
1401
1401
|
import { useMemo as useMemo7, useState as useState7 } from "react";
|
|
1402
1402
|
import { StyleSheet as StyleSheet5, View as View5 } from "react-native";
|
|
@@ -1419,7 +1419,7 @@ var GAME_PICKER_ID = "stats-game";
|
|
|
1419
1419
|
var STATS_MAX_WIDTH = 640;
|
|
1420
1420
|
function StatsScreen() {
|
|
1421
1421
|
const pickerHost = usePopoverHost3();
|
|
1422
|
-
return /* @__PURE__ */ jsx17(StatsPressAway, { host: pickerHost, children: /* @__PURE__ */ jsx17(
|
|
1422
|
+
return /* @__PURE__ */ jsx17(StatsPressAway, { host: pickerHost, children: /* @__PURE__ */ jsx17(ScreenFrame3, { portalHost: true, maxContentWidth: STATS_MAX_WIDTH, children: /* @__PURE__ */ jsx17(StatsContent, { pickerHost }) }) });
|
|
1423
1423
|
}
|
|
1424
1424
|
function StatsPressAway({ host, children }) {
|
|
1425
1425
|
return /* @__PURE__ */ jsx17(View5, { testID: "stats-press-away", style: styles5.screen, onStartShouldSetResponder: () => host.openId !== null, onResponderRelease: host.close, children });
|
|
@@ -1456,7 +1456,7 @@ function StatsContent({ pickerHost }) {
|
|
|
1456
1456
|
const surface = pack.Backdrop ? { backgroundColor: colors.surface } : void 0;
|
|
1457
1457
|
const triggerStyle = pack.Backdrop ? [styles5.pill, surface] : void 0;
|
|
1458
1458
|
const PackTabContent = packTab?.Content;
|
|
1459
|
-
return /* @__PURE__ */ jsxs6(BaseStatsScreen, { title, onBack: safeBack, insets, onReset: reset.onReset, resetLabel: reset.label, resetConfirmTitle: reset.title, resetConfirmBody: reset.body, fg: pack.foreground, bg: pack.Backdrop ? "transparent" : void 0,
|
|
1459
|
+
return /* @__PURE__ */ jsxs6(BaseStatsScreen, { title, onBack: safeBack, insets, onReset: reset.onReset, resetLabel: reset.label, resetConfirmTitle: reset.title, resetConfirmBody: reset.body, fg: pack.foreground, bg: pack.Backdrop ? "transparent" : void 0, children: [
|
|
1460
1460
|
/* @__PURE__ */ jsx17(PressAwayOverlay3, { active: pickerHost.openId !== null, onPress: pickerHost.close, style: styles5.pressAway }),
|
|
1461
1461
|
/* @__PURE__ */ jsx17(SegmentedButtons2, { value: tab, onValueChange: setTab, buttons: tabButtons, theme: SEGMENT_THEME, style: [styles5.tabs, surface] }),
|
|
1462
1462
|
/* @__PURE__ */ jsxs6(View5, { style: [styles5.filters, pickerHost.openId !== null && styles5.filtersOpen], onStartShouldSetResponder: () => pickerHost.openId !== null, children: [
|
|
@@ -1577,10 +1577,14 @@ function useActiveRound(game, defaults) {
|
|
|
1577
1577
|
|
|
1578
1578
|
// src/hooks/useBackBlock.ts
|
|
1579
1579
|
import { usePreventRemove } from "expo-router";
|
|
1580
|
-
import { useCallback as useCallback11, useRef as useRef6, useState as useState8 } from "react";
|
|
1581
|
-
function useBackBlock(held, onHeld) {
|
|
1580
|
+
import { useCallback as useCallback11, useEffect as useEffect8, useRef as useRef6, useState as useState8 } from "react";
|
|
1581
|
+
function useBackBlock(held, onHeld, leave = safeBack) {
|
|
1582
1582
|
const leavingRef = useRef6(false);
|
|
1583
1583
|
const [leaving, setLeaving] = useState8(false);
|
|
1584
|
+
const leaveRef = useRef6(leave);
|
|
1585
|
+
useEffect8(() => {
|
|
1586
|
+
leaveRef.current = leave;
|
|
1587
|
+
});
|
|
1584
1588
|
usePreventRemove(held && !leaving, ({ repeat }) => {
|
|
1585
1589
|
if (leavingRef.current) {
|
|
1586
1590
|
setLeaving(true);
|
|
@@ -1589,7 +1593,7 @@ function useBackBlock(held, onHeld) {
|
|
|
1589
1593
|
});
|
|
1590
1594
|
return useCallback11(() => {
|
|
1591
1595
|
leavingRef.current = true;
|
|
1592
|
-
|
|
1596
|
+
leaveRef.current();
|
|
1593
1597
|
}, []);
|
|
1594
1598
|
}
|
|
1595
1599
|
|
|
@@ -1601,10 +1605,8 @@ import { FLUSH, PAUSE, PERSIST, persistReducer, persistStore, PURGE, REGISTER, R
|
|
|
1601
1605
|
// src/redux/shellState.ts
|
|
1602
1606
|
import { createThemeReducer, getThirdColor as getThirdColor2 } from "@rific/auto-paper";
|
|
1603
1607
|
import { keepAwakeReducer } from "@rific/core";
|
|
1604
|
-
import {
|
|
1608
|
+
import { hapticReducer, soundReducer } from "@rific/feedback-press";
|
|
1605
1609
|
import { profilesReducer } from "@tastic/profile";
|
|
1606
|
-
var initialSoundSettings = { ...defaultSoundSettings, enabled: !__DEV__ };
|
|
1607
|
-
var appSoundReducer = (state = initialSoundSettings, action) => soundReducer(state, action);
|
|
1608
1610
|
function createShellReducers({ seatColors, appearance = "system", seatTheme }) {
|
|
1609
1611
|
return {
|
|
1610
1612
|
// Explicit primary/secondary triad (rather than a single seed expanded via harmony) so the pack's
|
|
@@ -1618,7 +1620,9 @@ function createShellReducers({ seatColors, appearance = "system", seatTheme }) {
|
|
|
1618
1620
|
// only when the pack's appearance is; hooks/useSeatColors.ts re-applies it with the live mode).
|
|
1619
1621
|
theme: createThemeReducer(seatTheme ? { appearance, ...seatTheme(seatColors, appearance === "dark") } : { appearance, color: { primary: seatColors[1], secondary: seatColors[2], tertiary: getThirdColor2(seatColors[1], seatColors[2]) } }),
|
|
1620
1622
|
haptic: hapticReducer,
|
|
1621
|
-
|
|
1623
|
+
// Starts off in a development build (feedback-press's defaultSoundSettings is `!__DEV__`), so local
|
|
1624
|
+
// testing on a simulator is silent; a production build starts with sound on.
|
|
1625
|
+
sound: soundReducer,
|
|
1622
1626
|
// @rific/core's Keep Awake setting (see Providers.tsx's KeepAwakeBridge), under the namespace its
|
|
1623
1627
|
// REHYDRATE handling expects.
|
|
1624
1628
|
keepAwake: keepAwakeReducer,
|
|
@@ -1639,11 +1643,6 @@ function createShellReducers({ seatColors, appearance = "system", seatTheme }) {
|
|
|
1639
1643
|
}
|
|
1640
1644
|
|
|
1641
1645
|
// src/redux/createPackStore.ts
|
|
1642
|
-
var hasError = (action) => typeof action === "object" && action !== null && "error" in action && Boolean(action.error);
|
|
1643
|
-
var errorMiddleware = () => (next) => (action) => {
|
|
1644
|
-
if (!hasError(action)) return next(action);
|
|
1645
|
-
return action;
|
|
1646
|
-
};
|
|
1647
1646
|
function createPackStore(pack, { keyPrefix, migrate, blacklist = [], serializableIgnoredPaths = [], middleware = [] }) {
|
|
1648
1647
|
const gameReducers = Object.assign({}, ...pack.games.map((game) => game.reducers));
|
|
1649
1648
|
const resumeReducers = pack.games.some((game) => game.resumable) ? { lastActiveGame: lastActiveGameSlice_default } : {};
|
|
@@ -1676,7 +1675,7 @@ function createPackStore(pack, { keyPrefix, migrate, blacklist = [], serializabl
|
|
|
1676
1675
|
ignoredPaths: [...serializableIgnoredPaths]
|
|
1677
1676
|
}
|
|
1678
1677
|
});
|
|
1679
|
-
return defaultMiddleware.concat(
|
|
1678
|
+
return defaultMiddleware.concat(...middleware);
|
|
1680
1679
|
},
|
|
1681
1680
|
reducer: persistedReducer
|
|
1682
1681
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tastic/shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "The app around a pack of React Native games, two-seat or for one player: Home, the loadout, the stats screen, Profiles and Settings, the pack's Redux store and its root providers, driven by one PackDefinition",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -83,12 +83,12 @@
|
|
|
83
83
|
"@rific/splash-gate": "^0.2.3",
|
|
84
84
|
"@rific/toaster": "^0.12.0",
|
|
85
85
|
"@rific/updater": "^0.8.0",
|
|
86
|
-
"@tastic/achievements": "^0.6.
|
|
87
|
-
"@tastic/core": "^0.
|
|
88
|
-
"@tastic/edge-guard": "^0.1
|
|
89
|
-
"@tastic/hud": "^0.
|
|
90
|
-
"@tastic/profile": "^0.
|
|
91
|
-
"@tastic/split-screen": "^0.
|
|
86
|
+
"@tastic/achievements": "^0.6.1",
|
|
87
|
+
"@tastic/core": "^0.17.0",
|
|
88
|
+
"@tastic/edge-guard": "^0.2.1",
|
|
89
|
+
"@tastic/hud": "^0.34.0",
|
|
90
|
+
"@tastic/profile": "^0.19.0",
|
|
91
|
+
"@tastic/split-screen": "^0.6.0",
|
|
92
92
|
"@testing-library/react-native": "^14.1.0",
|
|
93
93
|
"@types/jest": "30.0.0",
|
|
94
94
|
"@types/react": "~19.3.0",
|
|
@@ -137,10 +137,11 @@
|
|
|
137
137
|
"@rific/toaster": ">=0.10.1",
|
|
138
138
|
"@tastic/achievements": ">=0.6.0",
|
|
139
139
|
"@tastic/core": ">=0.16.0",
|
|
140
|
-
"@tastic/edge-guard": ">=0.
|
|
141
|
-
"@tastic/hud": ">=0.
|
|
140
|
+
"@tastic/edge-guard": ">=0.2.0",
|
|
141
|
+
"@tastic/hud": ">=0.34.0",
|
|
142
142
|
"@tastic/profile": ">=0.18.0",
|
|
143
143
|
"@tastic/split-screen": ">=0.5.5",
|
|
144
|
+
"expo-audio": ">=58.0.11",
|
|
144
145
|
"expo-blur": ">=58.0.4",
|
|
145
146
|
"expo-constants": ">=58.0.12",
|
|
146
147
|
"expo-font": ">=58.0.8",
|
package/src/RootLayout.tsx
CHANGED
|
@@ -2,7 +2,8 @@ import { useAutoPaperTheme } from '@rific/auto-paper'
|
|
|
2
2
|
import { useHapticSettings } from '@rific/feedback-press'
|
|
3
3
|
import { Toaster, ToastProvider } from '@rific/toaster'
|
|
4
4
|
import { useThemedRootBackground } from '@tastic/core'
|
|
5
|
-
import {
|
|
5
|
+
import { edgeGuardScreenOptions } from '@tastic/edge-guard'
|
|
6
|
+
import { ScreenFrame } from '@tastic/hud/chrome'
|
|
6
7
|
import { ProfileColorProvider } from '@tastic/profile'
|
|
7
8
|
import * as Haptics from 'expo-haptics'
|
|
8
9
|
import { DarkTheme, DefaultTheme, Stack, ThemeProvider as NavigationThemeProvider } from 'expo-router'
|
|
@@ -19,6 +20,7 @@ import { Providers } from './components/Providers'
|
|
|
19
20
|
import { Theme } from './components/Theme'
|
|
20
21
|
import { UpdateDialog } from './components/UpdateDialog'
|
|
21
22
|
import { WindowControlsInsets } from './components/WindowControlsInsets'
|
|
23
|
+
import { useAppSettings } from './hooks/useAppSettings'
|
|
22
24
|
import { LastActiveGameProvider } from './hooks/useLastActiveGame'
|
|
23
25
|
import { ProfilesProvider, useProfiles } from './hooks/useProfiles'
|
|
24
26
|
import { PackProvider, usePack } from './PackContext'
|
|
@@ -44,6 +46,13 @@ import type { PackDefinition, PackGameDefinition } from './types'
|
|
|
44
46
|
// auto-paper's Provider statusBar={false}). A play screen hides the bar for the whole round (a screen's
|
|
45
47
|
// own options win over screenOptions); index is listed first so it stays the stack's first route. A
|
|
46
48
|
// game with keepStatusBar (Solitaire's) keeps the stack's bar instead.
|
|
49
|
+
//
|
|
50
|
+
// Edge Guard's Android half rides on the same options: with it on, @tastic/edge-guard's
|
|
51
|
+
// edgeGuardScreenOptions hides both bars on a play screen in sticky immersive mode, so a swipe from
|
|
52
|
+
// any edge only brings them back for a moment (iOS's half is Providers' EdgeGuardBridge). For the whole
|
|
53
|
+
// play screen, not just a live round: hiding a bar changes the safe area, so flipping it as a round
|
|
54
|
+
// starts or pauses would resize anything a game lays out from the insets mid-match. On Android it
|
|
55
|
+
// hides the status bar of a keepStatusBar game too, since a visible one pulls the shade in one swipe.
|
|
47
56
|
const PLAY_OPTIONS = { statusBarHidden: true }
|
|
48
57
|
const KEEP_STATUS_BAR_OPTIONS = {}
|
|
49
58
|
|
|
@@ -79,12 +88,16 @@ function AppStack() {
|
|
|
79
88
|
// the outgoing screen opaque for ~450ms while the new one slides over it, which would show Home
|
|
80
89
|
// straight through a transparent play screen. iOS keeps its own push.
|
|
81
90
|
const backdropOptions = Backdrop ? { contentStyle: TRANSPARENT_CONTENT, animation: Platform.select({ android: 'fade' as const }) } : undefined
|
|
91
|
+
const { edgeGuard = true } = pack
|
|
92
|
+
const { deferBottomEdgeGestures } = useAppSettings().settings
|
|
93
|
+
const edgeGuardOptions = useMemo(() => edgeGuardScreenOptions(edgeGuard && deferBottomEdgeGestures), [edgeGuard, deferBottomEdgeGestures])
|
|
82
94
|
const playOptions = useCallback(
|
|
83
95
|
({ route }: { route: { params?: object } }) => {
|
|
84
96
|
const id = (route.params as { game?: string } | undefined)?.game
|
|
85
|
-
|
|
97
|
+
const statusBarOptions = pack.games.some((g) => g.id === id && g.keepStatusBar) ? KEEP_STATUS_BAR_OPTIONS : PLAY_OPTIONS
|
|
98
|
+
return { ...statusBarOptions, ...edgeGuardOptions }
|
|
86
99
|
},
|
|
87
|
-
[pack.games]
|
|
100
|
+
[pack.games, edgeGuardOptions]
|
|
88
101
|
)
|
|
89
102
|
const navigationBackground = Backdrop ? TRANSPARENT_CONTENT.backgroundColor : rootBackground.contentStyle.backgroundColor
|
|
90
103
|
const navigationTheme = useMemo(() => {
|
|
@@ -139,28 +152,20 @@ function HapticGatedToastProvider({ children }: { children: ReactNode }) {
|
|
|
139
152
|
)
|
|
140
153
|
}
|
|
141
154
|
|
|
142
|
-
function
|
|
143
|
-
const renderFrame = useCallback(
|
|
144
|
-
(toasts: ReactNode) => (
|
|
145
|
-
<RotatedFrame rotatedSafeArea passThrough>
|
|
146
|
-
{toasts}
|
|
147
|
-
</RotatedFrame>
|
|
148
|
-
),
|
|
149
|
-
[]
|
|
150
|
-
)
|
|
155
|
+
function FramedToaster() {
|
|
156
|
+
const renderFrame = useCallback((toasts: ReactNode) => <ScreenFrame passThrough>{toasts}</ScreenFrame>, [])
|
|
151
157
|
return <Toaster historyButton={null} clearButton={null} limit={3} renderFrame={renderFrame} />
|
|
152
158
|
}
|
|
153
159
|
|
|
154
|
-
// The pack's own toaster (PackDefinition.Toaster), laid over the whole app in hud's
|
|
155
|
-
//
|
|
156
|
-
//
|
|
157
|
-
// the layout beside the stack.
|
|
160
|
+
// The pack's own toaster (PackDefinition.Toaster), laid over the whole app in hud's ScreenFrame:
|
|
161
|
+
// passThrough, so only a toast claims a touch over the stack. The absoluteFill wrapper takes the frame
|
|
162
|
+
// out of the layout beside the stack.
|
|
158
163
|
function PackToaster({ Toaster: PackToasterComponent }: { Toaster: NonNullable<PackDefinition['Toaster']> }) {
|
|
159
164
|
return (
|
|
160
165
|
<View style={StyleSheet.absoluteFill} pointerEvents='box-none'>
|
|
161
|
-
<
|
|
166
|
+
<ScreenFrame passThrough>
|
|
162
167
|
<PackToasterComponent />
|
|
163
|
-
</
|
|
168
|
+
</ScreenFrame>
|
|
164
169
|
</View>
|
|
165
170
|
)
|
|
166
171
|
}
|
|
@@ -221,7 +226,7 @@ export function RootLayout({ pack, store, persistor }: RootLayoutProps) {
|
|
|
221
226
|
{/* historyButton/clearButton off: there's no toast history to open, and a
|
|
222
227
|
control row for it above the toast stack would go nowhere. limit pins the
|
|
223
228
|
package's current default (3) so a future toaster release can't change it. */}
|
|
224
|
-
{pack.Toaster ? <PackToaster Toaster={pack.Toaster} /> : <
|
|
229
|
+
{pack.Toaster ? <PackToaster Toaster={pack.Toaster} /> : <FramedToaster />}
|
|
225
230
|
<UpdateDialog />
|
|
226
231
|
</HapticGatedToastProvider>
|
|
227
232
|
</GatedApp>
|
|
@@ -4,7 +4,7 @@ import { useDispatch, useSelector } from 'react-redux'
|
|
|
4
4
|
import { type AppSettings, appSettingsActions } from '../redux/appSettingsSlice'
|
|
5
5
|
import type { ShellState } from '../redux/shellState'
|
|
6
6
|
|
|
7
|
-
// The one way the pack-wide settings are read and written (
|
|
7
|
+
// The one way the pack-wide settings are read and written (Edge Guard). Writes
|
|
8
8
|
// merge, so a patch only changes the fields it names.
|
|
9
9
|
export function useAppSettings(): { settings: AppSettings; setSettings: (patch: Partial<AppSettings>) => void } {
|
|
10
10
|
const settings = useSelector((state: ShellState) => state.appSettings)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { usePreventRemove } from 'expo-router'
|
|
2
|
-
import { useCallback, useRef, useState } from 'react'
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from 'react'
|
|
3
3
|
|
|
4
4
|
import { safeBack } from '../navigation'
|
|
5
5
|
|
|
@@ -13,6 +13,11 @@ import { safeBack } from '../navigation'
|
|
|
13
13
|
// calls this after that hook, with the same test it hands useQuitConfirmation. Off at Game Over, so
|
|
14
14
|
// a back there leaves at once, as the chip does.
|
|
15
15
|
//
|
|
16
|
+
// `leave` is where `quit` goes: safeBack unless the game says otherwise. A game whose Quit Match? can
|
|
17
|
+
// be opened from more than one place (CardTastic's tables: a back, or their Home button, which goes
|
|
18
|
+
// to Home past the setup screen) passes a function that reads which one opened it. It's read when
|
|
19
|
+
// `quit` runs, so it can change from render to render.
|
|
20
|
+
//
|
|
16
21
|
// The block stops every navigation off the screen while it's on, Quit's own included, so `quit` marks
|
|
17
22
|
// the way out first and the block lets that one through with `repeat` (expo-router's way to carry on
|
|
18
23
|
// with a navigation it stopped). The block goes off in the same handler as `repeat`, the order
|
|
@@ -22,9 +27,13 @@ import { safeBack } from '../navigation'
|
|
|
22
27
|
//
|
|
23
28
|
// While it's on, the web also asks before the page unloads (expo-router's usePreventRemove adds a
|
|
24
29
|
// beforeunload handler with it).
|
|
25
|
-
export function useBackBlock(held: boolean, onHeld: () => void): () => void {
|
|
30
|
+
export function useBackBlock(held: boolean, onHeld: () => void, leave: () => void = safeBack): () => void {
|
|
26
31
|
const leavingRef = useRef(false)
|
|
27
32
|
const [leaving, setLeaving] = useState(false)
|
|
33
|
+
const leaveRef = useRef(leave)
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
leaveRef.current = leave
|
|
36
|
+
})
|
|
28
37
|
usePreventRemove(held && !leaving, ({ repeat }) => {
|
|
29
38
|
if (leavingRef.current) {
|
|
30
39
|
setLeaving(true)
|
|
@@ -33,6 +42,6 @@ export function useBackBlock(held: boolean, onHeld: () => void): () => void {
|
|
|
33
42
|
})
|
|
34
43
|
return useCallback(() => {
|
|
35
44
|
leavingRef.current = true
|
|
36
|
-
|
|
45
|
+
leaveRef.current()
|
|
37
46
|
}, [])
|
|
38
47
|
}
|
|
@@ -6,13 +6,6 @@ import type { PackDefinition, PackGameDefinition } from '../types'
|
|
|
6
6
|
import lastActiveGame from './lastActiveGameSlice'
|
|
7
7
|
import { createShellReducers } from './shellState'
|
|
8
8
|
|
|
9
|
-
const hasError = (action: unknown): action is { error?: unknown } => typeof action === 'object' && action !== null && 'error' in action && Boolean(action.error)
|
|
10
|
-
|
|
11
|
-
const errorMiddleware: Middleware = () => (next) => (action) => {
|
|
12
|
-
if (!hasError(action)) return next(action)
|
|
13
|
-
return action
|
|
14
|
-
}
|
|
15
|
-
|
|
16
9
|
export interface PackStoreConfig {
|
|
17
10
|
// On web every Tastic app shares one origin (games.infinitetoken.com) and so one localStorage,
|
|
18
11
|
// where AsyncStorage keeps this state under keyPrefix + 'root': the default prefix would make every
|
|
@@ -76,7 +69,7 @@ export function createPackStore(pack: PackStoreSource, { keyPrefix, migrate, bla
|
|
|
76
69
|
ignoredPaths: [...serializableIgnoredPaths]
|
|
77
70
|
}
|
|
78
71
|
})
|
|
79
|
-
return defaultMiddleware.concat(
|
|
72
|
+
return defaultMiddleware.concat(...middleware)
|
|
80
73
|
},
|
|
81
74
|
reducer: persistedReducer
|
|
82
75
|
})
|
package/src/redux/shellState.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createThemeReducer, getThirdColor } from '@rific/auto-paper'
|
|
2
2
|
import { keepAwakeReducer } from '@rific/core'
|
|
3
|
-
import {
|
|
3
|
+
import { hapticReducer, soundReducer } from '@rific/feedback-press'
|
|
4
4
|
import { profilesReducer } from '@tastic/profile'
|
|
5
5
|
|
|
6
6
|
import type { PackDefinition } from '../types'
|
|
@@ -11,14 +11,6 @@ import opponent from './opponentSlice'
|
|
|
11
11
|
import profileSelection from './profileSelectionSlice'
|
|
12
12
|
import { createSeatColorsReducer } from './seatColorsSlice'
|
|
13
13
|
|
|
14
|
-
// @rific/feedback-press's own soundReducer defaults `enabled` to true unconditionally (that
|
|
15
|
-
// default isn't published with the dev-only override yet). Wrap it so a fresh install with no
|
|
16
|
-
// persisted preference (redux-persist finds nothing in AsyncStorage for the `sound` key) defaults
|
|
17
|
-
// muted in dev/simulator builds so Claude/local testing doesn't blast audio; production builds
|
|
18
|
-
// still default to sound on. All actual action handling still delegates to the package's reducer.
|
|
19
|
-
const initialSoundSettings: SoundSettings = { ...defaultSoundSettings, enabled: !__DEV__ }
|
|
20
|
-
const appSoundReducer = (state: SoundSettings = initialSoundSettings, action: { type: string }): SoundSettings => soundReducer(state, action)
|
|
21
|
-
|
|
22
14
|
// The store keys every pack has, whatever its games, built from the pack's own seat colors and
|
|
23
15
|
// appearance. Each game adds its own keys beside these (see GameDefinition.reducers).
|
|
24
16
|
export function createShellReducers({ seatColors, appearance = 'system', seatTheme }: Pick<PackDefinition, 'seatColors' | 'appearance' | 'seatTheme'>) {
|
|
@@ -34,7 +26,9 @@ export function createShellReducers({ seatColors, appearance = 'system', seatThe
|
|
|
34
26
|
// only when the pack's appearance is; hooks/useSeatColors.ts re-applies it with the live mode).
|
|
35
27
|
theme: createThemeReducer(seatTheme ? { appearance, ...seatTheme(seatColors, appearance === 'dark') } : { appearance, color: { primary: seatColors[1], secondary: seatColors[2], tertiary: getThirdColor(seatColors[1], seatColors[2]) } }),
|
|
36
28
|
haptic: hapticReducer,
|
|
37
|
-
|
|
29
|
+
// Starts off in a development build (feedback-press's defaultSoundSettings is `!__DEV__`), so local
|
|
30
|
+
// testing on a simulator is silent; a production build starts with sound on.
|
|
31
|
+
sound: soundReducer,
|
|
38
32
|
// @rific/core's Keep Awake setting (see Providers.tsx's KeepAwakeBridge), under the namespace its
|
|
39
33
|
// REHYDRATE handling expects.
|
|
40
34
|
keepAwake: keepAwakeReducer,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defaultColors } from '@rific/auto-paper'
|
|
2
|
-
import { type AlignResult,
|
|
2
|
+
import { type AlignResult, ScreenFrame } from '@tastic/hud/chrome'
|
|
3
3
|
import { ProfilesScreen } from '@tastic/profile'
|
|
4
4
|
|
|
5
5
|
import { useProfiles } from '../hooks/useProfiles'
|
|
@@ -14,10 +14,9 @@ const ROSTER_MAX_WIDTH = 640
|
|
|
14
14
|
// stats and achievements in every game: each game's reducers listen for the removal (see
|
|
15
15
|
// onProfileRemoved.ts).
|
|
16
16
|
//
|
|
17
|
-
// In hud's
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
// the wide layout. Over a
|
|
17
|
+
// In hud's ScreenFrame: ProfilesManager reads the safe-area insets itself (the header's padding); its
|
|
18
|
+
// delete confirm is a Paper Portal, which lands in a host inside the frame (portalHost); and the roster's
|
|
19
|
+
// column is capped in the wide layout. Over a
|
|
21
20
|
// pack's Backdrop the screen is transparent, drawn in the pack's foreground.
|
|
22
21
|
// The pack's own placement for a profile's color swatch (PackDefinition.usePickerAlign), kept inside the
|
|
23
22
|
// roster's capped column: the roster scrolls in it, which clips the menu at its edges. Handed to
|
|
@@ -32,8 +31,8 @@ export function ProfilesRoute() {
|
|
|
32
31
|
const { Backdrop, foreground, newProfileColor, usePickerAlign } = usePack()
|
|
33
32
|
|
|
34
33
|
return (
|
|
35
|
-
<
|
|
34
|
+
<ScreenFrame portalHost maxContentWidth={ROSTER_MAX_WIDTH}>
|
|
36
35
|
<ProfilesScreen profiles={profiles} defaultColor={newProfileColor ?? defaultColors[0].value} onCreate={(patch) => createProfile(patch)} onSave={(id, patch) => updateProfile(id, patch)} onDelete={deleteProfile} onBack={safeBack} fg={foreground} bg={Backdrop ? 'transparent' : undefined} useColorPickerAlign={usePickerAlign ? useRosterAlign : undefined} />
|
|
37
|
-
</
|
|
36
|
+
</ScreenFrame>
|
|
38
37
|
)
|
|
39
38
|
}
|