@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useAutoPaperTheme } from '@rific/auto-paper'
|
|
2
|
-
import { BaseStatsScreen, type PopoverHost, PressAwayOverlay,
|
|
2
|
+
import { BaseStatsScreen, type PopoverHost, PressAwayOverlay, ScreenFrame, usePopoverHost } from '@tastic/hud/chrome'
|
|
3
3
|
import { getOptionPickerContentSize, OptionPicker, type OptionPickerOption } from '@tastic/profile'
|
|
4
4
|
import { type ReactNode, useMemo, useState } from 'react'
|
|
5
5
|
import { StyleSheet, View } from 'react-native'
|
|
@@ -50,15 +50,15 @@ const STATS_MAX_WIDTH = 640
|
|
|
50
50
|
// can't be told apart. A pack for one player at a time (PackDefinition.guestStats) keeps a guest's
|
|
51
51
|
// stats under GUEST_PLAYER_ID, offers Guest in the picker and opens on whoever is in seat 1.
|
|
52
52
|
//
|
|
53
|
-
// In hud's
|
|
54
|
-
//
|
|
53
|
+
// In hud's ScreenFrame: it hosts the reset confirm's portal inside the frame, and caps the column in the
|
|
54
|
+
// wide layout.
|
|
55
55
|
export function StatsScreen() {
|
|
56
56
|
const pickerHost = usePopoverHost()
|
|
57
57
|
return (
|
|
58
58
|
<StatsPressAway host={pickerHost}>
|
|
59
|
-
<
|
|
59
|
+
<ScreenFrame portalHost maxContentWidth={STATS_MAX_WIDTH}>
|
|
60
60
|
<StatsContent pickerHost={pickerHost} />
|
|
61
|
-
</
|
|
61
|
+
</ScreenFrame>
|
|
62
62
|
</StatsPressAway>
|
|
63
63
|
)
|
|
64
64
|
}
|
|
@@ -85,7 +85,6 @@ const noPickerAlign = () => undefined
|
|
|
85
85
|
function StatsContent({ pickerHost }: { pickerHost: PopoverHost }) {
|
|
86
86
|
const pack = usePack()
|
|
87
87
|
const { dark, colors } = useAutoPaperTheme()
|
|
88
|
-
// Handed over by RotatedFrame's rotatedSafeArea.
|
|
89
88
|
const insets = useSafeAreaInsets()
|
|
90
89
|
const { profiles, lastSelected } = useProfiles()
|
|
91
90
|
const dispatch = useDispatch()
|
|
@@ -130,7 +129,7 @@ function StatsContent({ pickerHost }: { pickerHost: PopoverHost }) {
|
|
|
130
129
|
const PackTabContent = packTab?.Content
|
|
131
130
|
|
|
132
131
|
return (
|
|
133
|
-
<BaseStatsScreen title={title} onBack={safeBack} insets={insets} onReset={reset.onReset} resetLabel={reset.label} resetConfirmTitle={reset.title} resetConfirmBody={reset.body} fg={pack.foreground} bg={pack.Backdrop ? 'transparent' : undefined}
|
|
132
|
+
<BaseStatsScreen title={title} onBack={safeBack} insets={insets} onReset={reset.onReset} resetLabel={reset.label} resetConfirmTitle={reset.title} resetConfirmBody={reset.body} fg={pack.foreground} bg={pack.Backdrop ? 'transparent' : undefined}>
|
|
134
133
|
{/* Inside the page, not before it: BaseStatsScreen paints an opaque full-screen container that
|
|
135
134
|
would hide a tap catcher placed underneath it. Over the stat sections and under the open
|
|
136
135
|
filters (pressAway's zIndex sits below filtersOpen's), so a tap anywhere on the page but a
|
package/src/types.ts
CHANGED
|
@@ -342,7 +342,8 @@ export interface PackDefinition {
|
|
|
342
342
|
// game) and from Home's Settings, never in a play screen.
|
|
343
343
|
guide?: PackGuide
|
|
344
344
|
// Seat 1's button, on Home and in every loadout: the chip's label for a guest (default 'P1') and the
|
|
345
|
-
// guest row's in its menu (default @tastic/profile's).
|
|
345
|
+
// guest row's in its menu (default @tastic/profile's). A 2 Player loadout's seat 2 button takes the
|
|
346
|
+
// same two, its guest label defaulting to 'P2'.
|
|
346
347
|
guestLabel?: string
|
|
347
348
|
nullLabel?: string
|
|
348
349
|
// The stats screen keeps a guest's stats under GUEST_PLAYER_ID: a Guest entry in the player picker
|