@tastic/shell 0.10.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 +140 -19
- package/dist/index.d.mts +1 -6
- package/dist/index.d.ts +1 -6
- package/dist/index.js +11 -19
- package/dist/index.mjs +15 -23
- package/package.json +9 -8
- package/src/RootLayout.tsx +9 -17
- package/src/hooks/useAppSettings.ts +1 -1
- 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/README.md
CHANGED
|
@@ -28,12 +28,15 @@ package ecosystem, on [`@tastic/hud`](https://github.com/jayrdeaton/react-native
|
|
|
28
28
|
middleware })` builds one persisted store from the shell's keys (theme, haptics, sound, Keep Awake,
|
|
29
29
|
profiles, seat selection, seat colors, app settings, seat 2, the never-saved `liveplay`, and
|
|
30
30
|
`lastActiveGame` in a pack with a resumable game), the pack's own `reducers` and every game's own
|
|
31
|
-
`reducers`.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
`reducers`. Each of the shell's keys exports its reducer, actions and defaults, and
|
|
32
|
+
`createShellReducers` builds them all (see [The store's keys](#the-stores-keys)).
|
|
33
|
+
- **What a game builds on**: `createPlayerSettings` and `seatPlayerKey` (its settings and controls,
|
|
34
|
+
kept per player), `createGameStats` (its stats and achievements), `createGameGuideSlice` (which
|
|
35
|
+
version of its How to Play a player has seen), `onProfileRemoved` (forget a deleted profile),
|
|
36
|
+
`usePack` and `usePackGame`, `useActiveRound`, `useProfiles`, `useSeatColors`, `useOpponent`,
|
|
37
|
+
`useAppSettings`, `useGameGuide`, `useAtComputer`, `roundModeFor`, `humanSeatsFor`, `seatTwoFor`,
|
|
38
|
+
`MatchChips`, `SettingsDialog`, `safeBack`, `useBackBlock` (Android's and the browser's back
|
|
39
|
+
mid-match open Quit Match?) and `imageGameIcon` (see [Hooks and helpers](#hooks-and-helpers)).
|
|
37
40
|
|
|
38
41
|
## Install
|
|
39
42
|
|
|
@@ -123,7 +126,7 @@ PuckTastic and DuelTastic draw what they always did:
|
|
|
123
126
|
| `seatTheme?` | `(colors, dark) => ({ color, harmony })`: the theme the seats' colors make (a muted seed from seat 1's color), applied whenever they or dark mode change and as a fresh install's theme, in place of a triad of the raw colors. With it, `useSeatColors` reads each seat's color from where it's remembered (`seatColors`) rather than from the theme. |
|
|
124
127
|
| `previewColor?` | `(hex, dark) => string`: how every profile color is drawn (the seat buttons and their swatches on Home and in the loadouts, a loadout's Ready button and seat controls, each `ProfileChip`), mounted as `@tastic/profile`'s `ProfileColorProvider`. Saved colors stay as picked. |
|
|
125
128
|
| `guide?` | The pack's own How to Play (`PackGuide`: `version`, `selectVersionSeen`, `markSeen`, `getSteps({ touch })`), for cards that teach every game at once: shown on Home's first launch (never while a cold launch resumes a game), replayed from Home's Settings, never in a play screen. Its seen version is a key of the pack's own. |
|
|
126
|
-
| `guestLabel?`, `nullLabel?` | Seat 1's button on Home and in every loadout: the chip's label for a guest (default `'P1'`) and the guest row's in its menu. |
|
|
129
|
+
| `guestLabel?`, `nullLabel?` | Seat 1's button on Home and in every loadout: the chip's label for a guest (default `'P1'`) and the guest row's in its menu. A 2 Player loadout's seat 2 button takes the same two (its guest default `'P2'`). |
|
|
127
130
|
| `guestStats?` | The stats screen keeps a guest's stats under `GUEST_PLAYER_ID` (`'guest'`): a Guest entry between Everyone and the profiles once a profile exists, and the screen opens on seat 1's player. Without it the screen opens on Everyone, where guests count. |
|
|
128
131
|
| `AchievementList?` | One achievement list across the pack's games, on the Achievements tab, with the game picker hidden there. |
|
|
129
132
|
| `statsTabs?` | Tabs of the pack's own between Stats and Achievements (`PackStatsTab`: `value`, `label`, `Content`, handed both filters). With them every tab is as wide as its label, with no icons, so three fit a phone. |
|
|
@@ -136,8 +139,9 @@ PuckTastic and DuelTastic draw what they always did:
|
|
|
136
139
|
### `GameDefinition`
|
|
137
140
|
|
|
138
141
|
Each game is one object: its `id`, `title`, `blurb` and `icon` (a component drawn in the seats'
|
|
139
|
-
colors,
|
|
140
|
-
|
|
142
|
+
colors, handed `GameIconProps`: `size`, `p1Color`, `p2Color` and `dark`; or `imageGameIcon({ light,
|
|
143
|
+
dark })` for a light and dark pair of pictures), its seat 2 choices (`seatTwo`, each a `SeatTwo`: `'cpu'`,
|
|
144
|
+
`'person'`, `'nobody'`), whether 2 Player seats its players side by side
|
|
141
145
|
at a computer (`sideBySideAtComputer`) and in a wide window (`sideBySideWhenWide`), the store `reducers` it mounts, its root `Provider`, its `useLoadout(mode)`, its
|
|
142
146
|
`PlayScreen`, its `StatsSections` and `AchievementList`, `resetStats`, and its How to Play `guide`.
|
|
143
147
|
See `src/types.ts` for every field.
|
|
@@ -162,9 +166,29 @@ What a game can leave out or add, each optional, so a two-seat game sets none of
|
|
|
162
166
|
A game never imports another game, and the shell never imports a game: games reach the shell only
|
|
163
167
|
through the pack (`usePack()`).
|
|
164
168
|
|
|
169
|
+
`useLoadout(mode)` returns the game's part of the loadout (`GameLoadout`), built from its own saved
|
|
170
|
+
settings for the round `mode` seat 2 makes:
|
|
171
|
+
|
|
172
|
+
| Field | |
|
|
173
|
+
| --- | --- |
|
|
174
|
+
| `roundSettings` | The settings the round plays with, committed (liveplay's `activeRound.settings`) once every human seat is Ready. The play screen reads them back with `useActiveRound`. |
|
|
175
|
+
| `options` | `(props: LoadoutOptionsProps) => ReactNode`: the match-options row (board, rules, puck), drawn under the loadout's popover `host` in its colors (`accentColor`, `mutedColor`, `onAccentColor`, `dark`). `onRandomize` and `onReset` are undefined while the loadout folds them into its shared action band. |
|
|
176
|
+
| `optionIds` | The popover ids the options row opens, so the loadout lifts the row while one is open. |
|
|
177
|
+
| `randomize`, `reset` | The loadout's randomize and reset buttons. |
|
|
178
|
+
| `seatControl` | `(seat, host, look) => ReactNode \| undefined`: a human seat's controls picker (shot style, keys) in `look`'s colors (`SeatControlLook`: `accentColor`, `seatColor`, `mutedColor`, `dark`), or undefined where the game has none. |
|
|
179
|
+
| `cpuDifficulty?` | The CPU's levels (`{ value, options, onChange }`, the options hud's `MenuOption`s), saved per game, in player 1's opponent menu. Left out by a game with no seat 2, or whose CPU has no levels. |
|
|
180
|
+
|
|
181
|
+
A game's `guide` (`GameGuide`) builds its How to Play cards from the live settings: `version`,
|
|
182
|
+
`selectVersionSeen(state)` and `markSeen(version)` (from `createGameGuideSlice`), `selectInput(state)`
|
|
183
|
+
(the settings the cards read, as a flat object, compared shallowly) and `getSteps(input, { touch,
|
|
184
|
+
mode })`, hud's `GuideStep`s for a touch-first device or not and the round (`RoundMode`) seat 2's
|
|
185
|
+
saved choice makes in this game (`seatTwoFor`).
|
|
186
|
+
|
|
165
187
|
### `createPackStore`
|
|
166
188
|
|
|
167
|
-
`createPackStore(pack, config)
|
|
189
|
+
`createPackStore(pack, config)` returns `{ store, persistor }` (`PackStore` is the store's type). It
|
|
190
|
+
reads only the pack's `seatColors`, `appearance`, `seatTheme`, `reducers` and its games' `reducers` and
|
|
191
|
+
`resumable` (`PackStoreSource`). `config` is `PackStoreConfig`:
|
|
168
192
|
|
|
169
193
|
| Field | |
|
|
170
194
|
| --- | --- |
|
|
@@ -174,6 +198,97 @@ through the pack (`usePack()`).
|
|
|
174
198
|
| `serializableIgnoredPaths?` | State paths the dev serializability check skips (keys too big to walk on every action). |
|
|
175
199
|
| `middleware?` | The pack's own middleware, after the shell's (Solitaire's settings that follow the player). |
|
|
176
200
|
|
|
201
|
+
### The store's keys
|
|
202
|
+
|
|
203
|
+
`createPackStore` mounts these beside the pack's and the games' own keys.
|
|
204
|
+
`createShellReducers({ seatColors, appearance, seatTheme })` builds the same set (all but
|
|
205
|
+
`lastActiveGame`), and `ShellState` is their state, what a game's selectors read. Each key's reducer,
|
|
206
|
+
actions and defaults are exported for a pack's own code and its tests.
|
|
207
|
+
|
|
208
|
+
| Key | |
|
|
209
|
+
| --- | --- |
|
|
210
|
+
| `theme` | auto-paper's theme, starting from the pack's `appearance` and a triad of its `seatColors` (or what `seatTheme` makes of them). |
|
|
211
|
+
| `haptic`, `sound` | feedback-press's settings. Sound starts off in a development build. |
|
|
212
|
+
| `keepAwake` | `@rific/core`'s Keep Awake setting. |
|
|
213
|
+
| `profiles` | `@tastic/profile`'s roster, kept in step with the shared one (see `useProfiles`). |
|
|
214
|
+
| `profileSelection` | Which profile each seat last picked, null for a guest: `profileSelectionReducer`, starting from `defaultProfileSelectionState` (`{ 1: null, 2: null }`). `profileSelectionActions`: `select({ seat, profileId })` (a profile already in the other seat swaps the two), `clearProfile(profileId)` and `pruneToRoster(profileIds)`. Never shared with a sibling app. |
|
|
215
|
+
| `seatColors` | Each seat's remembered color: `createSeatColorsReducer(seatColors)`, starting from `defaultSeatColorsState(seatColors)` (each guest seat on its own seat color, the CPU on seat 2's, no profile picks). `seatColorsActions`: `setLastGuestColor({ seat, color })`, `setLastCpuColor(color)` and `setProfileColor({ profile, color })`, a profile's pick in this pack (null, or the profile's own color, drops it). |
|
|
216
|
+
| `appSettings` | Settings for the whole pack (`AppSettings`): `deferBottomEdgeGestures`, Edge Guard's opt-in, false in `DEFAULT_APP_SETTINGS`. `appSettingsReducer`, and `appSettingsActions.initialize(patch)`, which merges. Read and written with `useAppSettings`. |
|
|
217
|
+
| `opponent` | Who sits in seat 2 for the whole pack (`OpponentState`: `seatTwo`), the CPU in `DEFAULT_OPPONENT`. `opponentReducer`, and `opponentActions`: `setSeatTwo(seatTwo)` and `initialize(state)`. Read and written with `useOpponent`. |
|
|
218
|
+
| `liveplay` | This round, never saved (`LiveplaySliceState`): `activelyPlaying` (false) and `activeRound` (null until a loadout commits one; `ActiveRound`: `game`, `mode`, `settings`). `liveplayReducer`, and `liveplayActions`: `setActivelyPlaying(on)`, `setActiveRound(round)` and `initialize(state)`. A play screen sets `activelyPlaying` while a round is live and unpaused, and back to false as it unmounts: Edge Guard, when the player has turned it on, only guards while it's true. |
|
|
219
|
+
| `lastActiveGame` | Only in a pack with a `resumable` game: the play screen a cold launch resumes. Not exported. |
|
|
220
|
+
|
|
221
|
+
### Building a game's keys
|
|
222
|
+
|
|
223
|
+
- `createPlayerSettings({ id, defaults, distinctControls })`: a game's loadout settings, kept per
|
|
224
|
+
player. `defaults` holds every setting, with `controlScheme` (`{ 1, 2 }`) for each seat's controls.
|
|
225
|
+
The match settings follow seat 1's player (only what they changed is saved, so a setting added later
|
|
226
|
+
starts at its default), and each seat's controls follow the player in it (seat 2's only for a
|
|
227
|
+
person). `distinctControls`, optional, lists every control in menu order where the two seats can't
|
|
228
|
+
share one (a desktop key cluster): when both would get the same, seat 2 shows and plays the first
|
|
229
|
+
one seat 1 isn't using, never saved. It returns `reducers` (`<id>Settings` and `<id>Controls`, for
|
|
230
|
+
the game's own `reducers`), `settingsReducer`, `controlsReducer`, `actions` (`patch(player,
|
|
231
|
+
changes)`, `setControl(player, control)`), `compose(saved, controls, selection, seatTwoIsPerson)`,
|
|
232
|
+
`select(state)` (the same settings read straight from the store, as How to Play reads them) and
|
|
233
|
+
`useSettings()` (`{ settings, setSettings(patch) }`, the loadout's one write path). A deleted
|
|
234
|
+
profile's settings and controls go with it.
|
|
235
|
+
- `seatPlayerKey(selection, seat)`: who a seat's saved settings belong to: the profile picked for it,
|
|
236
|
+
or that seat's guest (`'guest:1'`, `'guest:2'`).
|
|
237
|
+
- `createGameStats({ key, defaultStats, isValidStats, catalog, getProfileStatsView })`: one game's
|
|
238
|
+
stats and achievements, on `@tastic/achievements`' `createAchievementsSlice` under the store key
|
|
239
|
+
`key`. The stats keep a `profiles` bucket per profile beside the device-wide totals, and
|
|
240
|
+
`getProfileStatsView(bucket)` shows a bucket in the same shape, so every achievement in `catalog`
|
|
241
|
+
reads either. `isValidStats` is optional. It returns `reducer` (a deleted profile takes its bucket
|
|
242
|
+
and unlocks with it), `actions`, `Provider` (the game's `Provider`) and `useStats()`: `stats`,
|
|
243
|
+
`unlockedAchievements`, `record(update, profileIds)`, which applies a result and returns what it
|
|
244
|
+
unlocked (`RecordResult`: `device`, and `profiles` by seat for each seat the optional `profileIds`
|
|
245
|
+
maps to a profile), and
|
|
246
|
+
`resetAll()`.
|
|
247
|
+
- `createGameGuideSlice(mountKey)`: which version of a game's How to Play a player has finished or
|
|
248
|
+
skipped, under the game's own key: `{ actions: { markSeen }, reducer, selectVersionSeen }`, for its
|
|
249
|
+
`GameGuide`. Unlike hud's `createGuideSlice`, a saved store without the key reads as not seen, so a
|
|
250
|
+
game added to a pack in an update shows its cards to everyone.
|
|
251
|
+
- `onProfileRemoved(reducer, forget)`: wraps a game's reducer so it runs `forget(state, profileId)`
|
|
252
|
+
when the Profiles screen deletes a profile (not when a sibling app's roster sync drops one).
|
|
253
|
+
`forgetProfileAchievements(dropStats)` is a `forget` for a `createAchievementsSlice` state: it drops
|
|
254
|
+
the profile's unlocks, and its stats through `dropStats(stats, profileId)`.
|
|
255
|
+
|
|
256
|
+
### Hooks and helpers
|
|
257
|
+
|
|
258
|
+
`RootLayout` mounts every provider these read.
|
|
259
|
+
|
|
260
|
+
- `usePack()`: the `PackDefinition`. `usePackGame(id)`: one of its games, or undefined for an id the
|
|
261
|
+
pack doesn't have. `PackProvider` (`pack`, `children`) provides them.
|
|
262
|
+
- `useProfiles()`: `profiles`, `lastSelected` (each seat's profile id, or null), `loaded`,
|
|
263
|
+
`createProfile(input)`, `updateProfile(id, patch)`, `deleteProfile(id)` (which also clears it from
|
|
264
|
+
any seat) and `selectProfile(seat, profileId)`. Its `ProfilesProvider` reconciles the saved roster
|
|
265
|
+
with `@tastic/profile`'s shared one in the App Group `group.com.infinitetoken.tastic` once at launch
|
|
266
|
+
(`loaded` turns true then, and the splash screen waits for it) and keeps the two in step.
|
|
267
|
+
- `useSeatColors(p2IsHuman)`: both seats' live colors and their pickers' handlers (`p1Color`,
|
|
268
|
+
`p2Color`, `handleP1ColorChange`, `handleP2ColorChange`), with the theme following them (see
|
|
269
|
+
`seatTheme`). A pick of the other seat's current color swaps the two.
|
|
270
|
+
- `useActiveRound(game, defaults)`: the round a play screen plays, `{ mode, settings }`: the one its
|
|
271
|
+
loadout committed, with its settings over `defaults`, or with none (a direct link, a web reload, a
|
|
272
|
+
game with no loadout) `defaults` and the mode a fresh install's seat 2 makes in this game.
|
|
273
|
+
- `useOpponent()`: `{ seatTwo, setSeatTwo }`, seat 2's saved choice for the whole pack.
|
|
274
|
+
- `useAppSettings()`: `{ settings, setSettings(patch) }`, the pack-wide settings (`AppSettings`). A
|
|
275
|
+
patch changes only the fields it names.
|
|
276
|
+
- `useGameGuide()`: How to Play. `openFirstTime(gameId, next)` shows a game's cards if this player
|
|
277
|
+
hasn't finished or skipped this version, then runs `next` once they close (at once otherwise);
|
|
278
|
+
`openFor(gameId)` shows them now; `openPack()` shows the pack's own `guide`; `autoShowPack()` shows
|
|
279
|
+
it once per session while unseen (Home's first launch). A game with no cards of its own opens
|
|
280
|
+
nothing.
|
|
281
|
+
- `useAtComputer()`: true on the web without a touch-first screen (`@tastic/core`'s
|
|
282
|
+
`useIsTouchPrimaryDevice`), where `sideBySideAtComputer` and `MatchChips` see a computer.
|
|
283
|
+
- `roundModeFor(seatTwo)`: `'cpu'` is `'vsCpu'`, `'person'` `'twoPlayer'` and `'nobody'` `'solo'`.
|
|
284
|
+
`humanSeatsFor(mode)`: the seats that press Ready, `[1, 2]` in 2 Player and `[1]` otherwise.
|
|
285
|
+
`seatTwoFor(saved, choices)`: seat 2's saved choice as one game reads it (see `GameDefinition`).
|
|
286
|
+
- `SettingsDialog` (`SettingsDialogProps`): `visible`, `onDismiss`, `onShowHowToPlay` (optional: shows
|
|
287
|
+
the How to Play row, as a loadout does; left out on Home and in a match) and `children` (a play
|
|
288
|
+
screen's own rows). The pack's `useSettingsRules` goes above the shell's rows, and `children` and
|
|
289
|
+
then the pack's `SettingsSections` under them.
|
|
290
|
+
- `safeBack()`: back, or Home (`/`) where there's nothing to go back to.
|
|
291
|
+
|
|
177
292
|
### On every pack (0.2.0)
|
|
178
293
|
|
|
179
294
|
Six fixes CardTastic's move brought to every pack's screens: Home's press-away overlay sits in the
|
|
@@ -182,7 +297,7 @@ scroller, so a press on a row played the game), seat 1's menu closes on every ch
|
|
|
182
297
|
Home's scrollers fade out at an edge with more past it (auto-paper's `FadingScrollView`), a press
|
|
183
298
|
anywhere on the stats screen (its header and margins too) closes a picker's menu, the stats screen's
|
|
184
299
|
column is capped at 640pt in the wide layout, and Profiles' roster is capped at 640pt in the wide
|
|
185
|
-
layout (hud's `
|
|
300
|
+
layout (hud's `ScreenFrame`, `RotatedFrame` before hud 0.34). Every hud import goes through `@tastic/hud/chrome`,
|
|
186
301
|
`/guide` or `/lobby`, so an app with no Skia can install the shell; a pack's own imports don't change.
|
|
187
302
|
The shell's routes are handed to expo-router as plain `Href`s, so an app with typed routes type-checks
|
|
188
303
|
the shell before its own routes match.
|
|
@@ -202,7 +317,7 @@ longer reads the accelerometer, draws a turn or offers Lock Orientation. A pack
|
|
|
202
317
|
### The chips over a match (0.6.0)
|
|
203
318
|
|
|
204
319
|
`MatchChips` is every game's back and settings chips during a match, so they sit and show the same
|
|
205
|
-
way in every game of every pack. A play screen renders it with `playing` (true while play is on: a
|
|
320
|
+
way in every game of every pack. A play screen renders it (`MatchChipsProps`) with `playing` (true while play is on: a
|
|
206
321
|
live puck, a shot in flight, a round being ridden), `faceToFace` (two players at opposite ends of the
|
|
207
322
|
screen right now) and `onBack`/`onSettings`, plus `centerLineY` when the line between the players isn't
|
|
208
323
|
the window's middle.
|
|
@@ -249,8 +364,9 @@ const quit = useBackBlock(hasProgress, requestBack)
|
|
|
249
364
|
|
|
250
365
|
## Peer dependencies
|
|
251
366
|
|
|
252
|
-
None are bundled. The floors
|
|
253
|
-
became a package (the lower of the two where they differ)
|
|
367
|
+
None are bundled. The floors started as the versions PuckTastic and DuelTastic ran the shell on when
|
|
368
|
+
it became a package (the lower of the two where they differ), and some have been raised since for
|
|
369
|
+
what the shell started using (noted in the table).
|
|
254
370
|
|
|
255
371
|
| Peer | Floor | Used for |
|
|
256
372
|
| --- | --- | --- |
|
|
@@ -261,19 +377,24 @@ became a package (the lower of the two where they differ).
|
|
|
261
377
|
| `expo-constants` | >=58.0.12 | the web tab title |
|
|
262
378
|
| `expo-blur`, `@react-native-masked-view/masked-view` | >=58.0.4, >=0.3.2 | auto-paper's blur and its scroll fade, Home's fading scrollers |
|
|
263
379
|
| `expo-haptics`, `expo-keep-awake` | >=58.0.7, >=58.0.3 | the toaster's haptics, Keep Awake |
|
|
380
|
+
| `expo-audio` | >=58.0.11 | the UI sounds, through `@rific/feedback-press/audio` |
|
|
264
381
|
| `react-native-gesture-handler`, `react-native-reanimated`, `react-native-safe-area-context` | >=3.3.0, >=4.7.1, >=5.11.0 | the gesture root, auto-paper's dialogs and the loadout's fades, insets (with room for iPadOS's window controls) |
|
|
265
382
|
| `react-native-paper` | >=5.15.3 | text, icons, the toaster and feedback-press |
|
|
266
383
|
| `@reduxjs/toolkit`, `redux`, `react-redux`, `redux-persist`, `@react-native-async-storage/async-storage` | >=2.13.0, >=5.0.1, >=9.3.0, >=6.0.0, >=2.2.0 | the store and where it's saved |
|
|
267
384
|
| `@rific/auto-paper` | >=0.13.4 | the theme |
|
|
268
385
|
| `@rific/core` | >=0.5.0 | settings slices, Keep Awake, `safeBack` |
|
|
269
386
|
| `@rific/feedback-press` | >=0.13.1 | haptic and sound settings, the UI sounds |
|
|
270
|
-
| `@rific/toaster` | >=0.10.1 | toasts
|
|
271
|
-
| `@tastic/core` | >=0.
|
|
272
|
-
| `@tastic/hud` | >=0.
|
|
273
|
-
| `@tastic/profile` | >=0.
|
|
387
|
+
| `@rific/toaster` | >=0.10.1 | toasts |
|
|
388
|
+
| `@tastic/core` | >=0.16.0 | the seat mode from the window's shape, the root background, the test for a computer behind `useAtComputer` (0.16.0's `useIsTouchPrimaryDevice`) |
|
|
389
|
+
| `@tastic/hud` | >=0.34.0 | Settings, the stats screen, the loadout's panels (its Skia-free `/lobby` entry, new in 0.26.0; 0.27.1's options for a pack drawn on its own backdrop; 0.28.0's Ready pill; 0.29.0's leading Settings sections), How to Play, and `ScreenFrame` around the stats screen, Profiles and the toaster (0.34.0, where `RotatedFrame` became `ScreenFrame`) |
|
|
390
|
+
| `@tastic/profile` | >=0.18.0 | profiles and the shared roster, the seat buttons, seat colors, the dividers in player 1's opponent menu (0.18.0's `dividerBefore`) |
|
|
274
391
|
| `@tastic/achievements` | >=0.6.0 | `createGameStats`, `forgetProfileAchievements` |
|
|
275
392
|
| `@tastic/split-screen` | >=0.5.5 | the 2 Player loadout's two halves |
|
|
276
393
|
| `@tastic/edge-guard` | >=0.2.0 | Edge Guard during play (`useEdgeGestureGuard` on iOS, `edgeGuardScreenOptions` on Android) |
|
|
277
394
|
|
|
278
395
|
The two UI sounds every button plays (`assets/sounds/select.wav` and `notification.wav`) ship with the
|
|
279
|
-
package.
|
|
396
|
+
package. They play through `@rific/feedback-press/audio`'s `useAudioPool`, which imports `expo-audio`.
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
400
|
+
Made by [Infinite Token](https://www.infinitetoken.com), the team behind [Lumber](https://lumber.infinitetoken.com): end-to-end encrypted logging.
|
package/dist/index.d.mts
CHANGED
|
@@ -14,7 +14,6 @@ export { safeBack } from '@rific/core';
|
|
|
14
14
|
import * as _tastic_profile from '@tastic/profile';
|
|
15
15
|
import { profilesReducer, Profile, CreateProfileInput, SeatColorsState as SeatColorsState$1 } from '@tastic/profile';
|
|
16
16
|
import * as _rific_feedback_press from '@rific/feedback-press';
|
|
17
|
-
import { SoundSettings } from '@rific/feedback-press';
|
|
18
17
|
import * as redux_persist from 'redux-persist';
|
|
19
18
|
import { PersistedState, Persistor } from 'redux-persist';
|
|
20
19
|
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
@@ -105,9 +104,7 @@ type LastActiveGameState = {
|
|
|
105
104
|
declare function createShellReducers({ seatColors, appearance, seatTheme }: Pick<PackDefinition, 'seatColors' | 'appearance' | 'seatTheme'>): {
|
|
106
105
|
theme: _rific_core.SettingsReducer<_rific_auto_paper.ThemeState>;
|
|
107
106
|
haptic: _rific_core.SettingsReducer<_rific_feedback_press.HapticSettings>;
|
|
108
|
-
sound:
|
|
109
|
-
type: string;
|
|
110
|
-
}) => SoundSettings;
|
|
107
|
+
sound: _rific_core.SettingsReducer<_rific_feedback_press.SoundSettings>;
|
|
111
108
|
keepAwake: _rific_core.SettingsReducer<_rific_core.KeepAwakeSettings>;
|
|
112
109
|
profiles: typeof profilesReducer;
|
|
113
110
|
profileSelection: (state: _tastic_profile.ProfileSelectionState<Seat> | undefined, action: {
|
|
@@ -342,8 +339,6 @@ declare function createPackStore(pack: PackStoreSource, { keyPrefix, migrate, bl
|
|
|
342
339
|
liveplay: LiveplaySliceState;
|
|
343
340
|
} & redux_persist_es_persistReducer.PersistPartial, {
|
|
344
341
|
type: string;
|
|
345
|
-
} | {
|
|
346
|
-
type: string;
|
|
347
342
|
payload?: unknown;
|
|
348
343
|
} | {
|
|
349
344
|
type: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export { safeBack } from '@rific/core';
|
|
|
14
14
|
import * as _tastic_profile from '@tastic/profile';
|
|
15
15
|
import { profilesReducer, Profile, CreateProfileInput, SeatColorsState as SeatColorsState$1 } from '@tastic/profile';
|
|
16
16
|
import * as _rific_feedback_press from '@rific/feedback-press';
|
|
17
|
-
import { SoundSettings } from '@rific/feedback-press';
|
|
18
17
|
import * as redux_persist from 'redux-persist';
|
|
19
18
|
import { PersistedState, Persistor } from 'redux-persist';
|
|
20
19
|
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
@@ -105,9 +104,7 @@ type LastActiveGameState = {
|
|
|
105
104
|
declare function createShellReducers({ seatColors, appearance, seatTheme }: Pick<PackDefinition, 'seatColors' | 'appearance' | 'seatTheme'>): {
|
|
106
105
|
theme: _rific_core.SettingsReducer<_rific_auto_paper.ThemeState>;
|
|
107
106
|
haptic: _rific_core.SettingsReducer<_rific_feedback_press.HapticSettings>;
|
|
108
|
-
sound:
|
|
109
|
-
type: string;
|
|
110
|
-
}) => SoundSettings;
|
|
107
|
+
sound: _rific_core.SettingsReducer<_rific_feedback_press.SoundSettings>;
|
|
111
108
|
keepAwake: _rific_core.SettingsReducer<_rific_core.KeepAwakeSettings>;
|
|
112
109
|
profiles: typeof profilesReducer;
|
|
113
110
|
profileSelection: (state: _tastic_profile.ProfileSelectionState<Seat> | undefined, action: {
|
|
@@ -342,8 +339,6 @@ declare function createPackStore(pack: PackStoreSource, { keyPrefix, migrate, bl
|
|
|
342
339
|
liveplay: LiveplaySliceState;
|
|
343
340
|
} & redux_persist_es_persistReducer.PersistPartial, {
|
|
344
341
|
type: string;
|
|
345
|
-
} | {
|
|
346
|
-
type: string;
|
|
347
342
|
payload?: unknown;
|
|
348
343
|
} | {
|
|
349
344
|
type: string;
|
package/dist/index.js
CHANGED
|
@@ -535,15 +535,12 @@ function HapticGatedToastProvider({ children }) {
|
|
|
535
535
|
const { Toaster: PackToasterComponent } = usePack();
|
|
536
536
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_toaster2.ToastProvider, { haptics: settings.vibrate ? Haptics : void 0, paper: PackToasterComponent ? void 0 : RNPaper2, children });
|
|
537
537
|
}
|
|
538
|
-
function
|
|
539
|
-
const renderFrame = (0, import_react9.useCallback)(
|
|
540
|
-
(toasts) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_chrome2.RotatedFrame, { rotatedSafeArea: true, passThrough: true, children: toasts }),
|
|
541
|
-
[]
|
|
542
|
-
);
|
|
538
|
+
function FramedToaster() {
|
|
539
|
+
const renderFrame = (0, import_react9.useCallback)((toasts) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_chrome2.ScreenFrame, { passThrough: true, children: toasts }), []);
|
|
543
540
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_toaster2.Toaster, { historyButton: null, clearButton: null, limit: 3, renderFrame });
|
|
544
541
|
}
|
|
545
542
|
function PackToaster({ Toaster: PackToasterComponent }) {
|
|
546
|
-
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.
|
|
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, {}) }) });
|
|
547
544
|
}
|
|
548
545
|
function GameProviders({ games, children }) {
|
|
549
546
|
return games.reduceRight((inner, game) => game.Provider ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(game.Provider, { children: inner }, game.id) : inner, children);
|
|
@@ -561,7 +558,7 @@ function PackRoot({ pack, children }) {
|
|
|
561
558
|
function RootLayout({ pack, store, persistor }) {
|
|
562
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: [
|
|
563
560
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(GuideHost, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AppStack, {}) }),
|
|
564
|
-
pack.Toaster ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PackToaster, { Toaster: pack.Toaster }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
561
|
+
pack.Toaster ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PackToaster, { Toaster: pack.Toaster }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FramedToaster, {}),
|
|
565
562
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(UpdateDialog, {})
|
|
566
563
|
] }) }) }) }) }) }) }) }) }) }) }) }) });
|
|
567
564
|
}
|
|
@@ -1472,7 +1469,7 @@ function useRosterAlign(open, contentWidth, contentHeight) {
|
|
|
1472
1469
|
function ProfilesRoute() {
|
|
1473
1470
|
const { profiles, createProfile, updateProfile, deleteProfile } = useProfiles();
|
|
1474
1471
|
const { Backdrop, foreground, newProfileColor, usePickerAlign } = usePack();
|
|
1475
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_chrome6.
|
|
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 }) });
|
|
1476
1473
|
}
|
|
1477
1474
|
|
|
1478
1475
|
// src/screens/StatsScreen.tsx
|
|
@@ -1500,7 +1497,7 @@ var GAME_PICKER_ID = "stats-game";
|
|
|
1500
1497
|
var STATS_MAX_WIDTH = 640;
|
|
1501
1498
|
function StatsScreen() {
|
|
1502
1499
|
const pickerHost = (0, import_chrome7.usePopoverHost)();
|
|
1503
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(StatsPressAway, { host: pickerHost, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_chrome7.
|
|
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 }) }) });
|
|
1504
1501
|
}
|
|
1505
1502
|
function StatsPressAway({ host, children }) {
|
|
1506
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 });
|
|
@@ -1537,7 +1534,7 @@ function StatsContent({ pickerHost }) {
|
|
|
1537
1534
|
const surface = pack.Backdrop ? { backgroundColor: colors.surface } : void 0;
|
|
1538
1535
|
const triggerStyle = pack.Backdrop ? [styles5.pill, surface] : void 0;
|
|
1539
1536
|
const PackTabContent = packTab?.Content;
|
|
1540
|
-
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,
|
|
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: [
|
|
1541
1538
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_chrome7.PressAwayOverlay, { active: pickerHost.openId !== null, onPress: pickerHost.close, style: styles5.pressAway }),
|
|
1542
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] }),
|
|
1543
1540
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native10.View, { style: [styles5.filters, pickerHost.openId !== null && styles5.filtersOpen], onStartShouldSetResponder: () => pickerHost.openId !== null, children: [
|
|
@@ -1688,8 +1685,6 @@ var import_auto_paper9 = require("@rific/auto-paper");
|
|
|
1688
1685
|
var import_core12 = require("@rific/core");
|
|
1689
1686
|
var import_feedback_press5 = require("@rific/feedback-press");
|
|
1690
1687
|
var import_profile10 = require("@tastic/profile");
|
|
1691
|
-
var initialSoundSettings = { ...import_feedback_press5.defaultSoundSettings, enabled: !__DEV__ };
|
|
1692
|
-
var appSoundReducer = (state = initialSoundSettings, action) => (0, import_feedback_press5.soundReducer)(state, action);
|
|
1693
1688
|
function createShellReducers({ seatColors, appearance = "system", seatTheme }) {
|
|
1694
1689
|
return {
|
|
1695
1690
|
// Explicit primary/secondary triad (rather than a single seed expanded via harmony) so the pack's
|
|
@@ -1703,7 +1698,9 @@ function createShellReducers({ seatColors, appearance = "system", seatTheme }) {
|
|
|
1703
1698
|
// only when the pack's appearance is; hooks/useSeatColors.ts re-applies it with the live mode).
|
|
1704
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]) } }),
|
|
1705
1700
|
haptic: import_feedback_press5.hapticReducer,
|
|
1706
|
-
|
|
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,
|
|
1707
1704
|
// @rific/core's Keep Awake setting (see Providers.tsx's KeepAwakeBridge), under the namespace its
|
|
1708
1705
|
// REHYDRATE handling expects.
|
|
1709
1706
|
keepAwake: import_core12.keepAwakeReducer,
|
|
@@ -1724,11 +1721,6 @@ function createShellReducers({ seatColors, appearance = "system", seatTheme }) {
|
|
|
1724
1721
|
}
|
|
1725
1722
|
|
|
1726
1723
|
// src/redux/createPackStore.ts
|
|
1727
|
-
var hasError = (action) => typeof action === "object" && action !== null && "error" in action && Boolean(action.error);
|
|
1728
|
-
var errorMiddleware = () => (next) => (action) => {
|
|
1729
|
-
if (!hasError(action)) return next(action);
|
|
1730
|
-
return action;
|
|
1731
|
-
};
|
|
1732
1724
|
function createPackStore(pack, { keyPrefix, migrate, blacklist = [], serializableIgnoredPaths = [], middleware = [] }) {
|
|
1733
1725
|
const gameReducers = Object.assign({}, ...pack.games.map((game) => game.reducers));
|
|
1734
1726
|
const resumeReducers = pack.games.some((game) => game.resumable) ? { lastActiveGame: lastActiveGameSlice_default } : {};
|
|
@@ -1761,7 +1753,7 @@ function createPackStore(pack, { keyPrefix, migrate, blacklist = [], serializabl
|
|
|
1761
1753
|
ignoredPaths: [...serializableIgnoredPaths]
|
|
1762
1754
|
}
|
|
1763
1755
|
});
|
|
1764
|
-
return defaultMiddleware.concat(
|
|
1756
|
+
return defaultMiddleware.concat(...middleware);
|
|
1765
1757
|
},
|
|
1766
1758
|
reducer: persistedReducer
|
|
1767
1759
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -27,7 +27,7 @@ import { useHapticSettings } from "@rific/feedback-press";
|
|
|
27
27
|
import { Toaster, ToastProvider } from "@rific/toaster";
|
|
28
28
|
import { useThemedRootBackground } from "@tastic/core";
|
|
29
29
|
import { edgeGuardScreenOptions } from "@tastic/edge-guard";
|
|
30
|
-
import {
|
|
30
|
+
import { ScreenFrame } from "@tastic/hud/chrome";
|
|
31
31
|
import { ProfileColorProvider } from "@tastic/profile";
|
|
32
32
|
import * as Haptics from "expo-haptics";
|
|
33
33
|
import { DarkTheme, DefaultTheme, Stack, ThemeProvider as NavigationThemeProvider } from "expo-router";
|
|
@@ -457,15 +457,12 @@ function HapticGatedToastProvider({ children }) {
|
|
|
457
457
|
const { Toaster: PackToasterComponent } = usePack();
|
|
458
458
|
return /* @__PURE__ */ jsx10(ToastProvider, { haptics: settings.vibrate ? Haptics : void 0, paper: PackToasterComponent ? void 0 : RNPaper2, children });
|
|
459
459
|
}
|
|
460
|
-
function
|
|
461
|
-
const renderFrame = useCallback6(
|
|
462
|
-
(toasts) => /* @__PURE__ */ jsx10(RotatedFrame, { rotatedSafeArea: true, passThrough: true, children: toasts }),
|
|
463
|
-
[]
|
|
464
|
-
);
|
|
460
|
+
function FramedToaster() {
|
|
461
|
+
const renderFrame = useCallback6((toasts) => /* @__PURE__ */ jsx10(ScreenFrame, { passThrough: true, children: toasts }), []);
|
|
465
462
|
return /* @__PURE__ */ jsx10(Toaster, { historyButton: null, clearButton: null, limit: 3, renderFrame });
|
|
466
463
|
}
|
|
467
464
|
function PackToaster({ Toaster: PackToasterComponent }) {
|
|
468
|
-
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, {}) }) });
|
|
469
466
|
}
|
|
470
467
|
function GameProviders({ games, children }) {
|
|
471
468
|
return games.reduceRight((inner, game) => game.Provider ? /* @__PURE__ */ jsx10(game.Provider, { children: inner }, game.id) : inner, children);
|
|
@@ -483,7 +480,7 @@ function PackRoot({ pack, children }) {
|
|
|
483
480
|
function RootLayout({ pack, store, persistor }) {
|
|
484
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: [
|
|
485
482
|
/* @__PURE__ */ jsx10(GuideHost, { children: /* @__PURE__ */ jsx10(AppStack, {}) }),
|
|
486
|
-
pack.Toaster ? /* @__PURE__ */ jsx10(PackToaster, { Toaster: pack.Toaster }) : /* @__PURE__ */ jsx10(
|
|
483
|
+
pack.Toaster ? /* @__PURE__ */ jsx10(PackToaster, { Toaster: pack.Toaster }) : /* @__PURE__ */ jsx10(FramedToaster, {}),
|
|
487
484
|
/* @__PURE__ */ jsx10(UpdateDialog, {})
|
|
488
485
|
] }) }) }) }) }) }) }) }) }) }) }) }) });
|
|
489
486
|
}
|
|
@@ -1383,7 +1380,7 @@ var styles4 = StyleSheet4.create({
|
|
|
1383
1380
|
|
|
1384
1381
|
// src/screens/ProfilesRoute.tsx
|
|
1385
1382
|
import { defaultColors as defaultColors3 } from "@rific/auto-paper";
|
|
1386
|
-
import {
|
|
1383
|
+
import { ScreenFrame as ScreenFrame2 } from "@tastic/hud/chrome";
|
|
1387
1384
|
import { ProfilesScreen } from "@tastic/profile";
|
|
1388
1385
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1389
1386
|
var ROSTER_MAX_WIDTH = 640;
|
|
@@ -1394,12 +1391,12 @@ function useRosterAlign(open, contentWidth, contentHeight) {
|
|
|
1394
1391
|
function ProfilesRoute() {
|
|
1395
1392
|
const { profiles, createProfile, updateProfile, deleteProfile } = useProfiles();
|
|
1396
1393
|
const { Backdrop, foreground, newProfileColor, usePickerAlign } = usePack();
|
|
1397
|
-
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 }) });
|
|
1398
1395
|
}
|
|
1399
1396
|
|
|
1400
1397
|
// src/screens/StatsScreen.tsx
|
|
1401
1398
|
import { useAutoPaperTheme as useAutoPaperTheme5 } from "@rific/auto-paper";
|
|
1402
|
-
import { BaseStatsScreen, PressAwayOverlay as PressAwayOverlay3,
|
|
1399
|
+
import { BaseStatsScreen, PressAwayOverlay as PressAwayOverlay3, ScreenFrame as ScreenFrame3, usePopoverHost as usePopoverHost3 } from "@tastic/hud/chrome";
|
|
1403
1400
|
import { getOptionPickerContentSize as getOptionPickerContentSize2, OptionPicker as OptionPicker2 } from "@tastic/profile";
|
|
1404
1401
|
import { useMemo as useMemo7, useState as useState7 } from "react";
|
|
1405
1402
|
import { StyleSheet as StyleSheet5, View as View5 } from "react-native";
|
|
@@ -1422,7 +1419,7 @@ var GAME_PICKER_ID = "stats-game";
|
|
|
1422
1419
|
var STATS_MAX_WIDTH = 640;
|
|
1423
1420
|
function StatsScreen() {
|
|
1424
1421
|
const pickerHost = usePopoverHost3();
|
|
1425
|
-
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 }) }) });
|
|
1426
1423
|
}
|
|
1427
1424
|
function StatsPressAway({ host, children }) {
|
|
1428
1425
|
return /* @__PURE__ */ jsx17(View5, { testID: "stats-press-away", style: styles5.screen, onStartShouldSetResponder: () => host.openId !== null, onResponderRelease: host.close, children });
|
|
@@ -1459,7 +1456,7 @@ function StatsContent({ pickerHost }) {
|
|
|
1459
1456
|
const surface = pack.Backdrop ? { backgroundColor: colors.surface } : void 0;
|
|
1460
1457
|
const triggerStyle = pack.Backdrop ? [styles5.pill, surface] : void 0;
|
|
1461
1458
|
const PackTabContent = packTab?.Content;
|
|
1462
|
-
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: [
|
|
1463
1460
|
/* @__PURE__ */ jsx17(PressAwayOverlay3, { active: pickerHost.openId !== null, onPress: pickerHost.close, style: styles5.pressAway }),
|
|
1464
1461
|
/* @__PURE__ */ jsx17(SegmentedButtons2, { value: tab, onValueChange: setTab, buttons: tabButtons, theme: SEGMENT_THEME, style: [styles5.tabs, surface] }),
|
|
1465
1462
|
/* @__PURE__ */ jsxs6(View5, { style: [styles5.filters, pickerHost.openId !== null && styles5.filtersOpen], onStartShouldSetResponder: () => pickerHost.openId !== null, children: [
|
|
@@ -1608,10 +1605,8 @@ import { FLUSH, PAUSE, PERSIST, persistReducer, persistStore, PURGE, REGISTER, R
|
|
|
1608
1605
|
// src/redux/shellState.ts
|
|
1609
1606
|
import { createThemeReducer, getThirdColor as getThirdColor2 } from "@rific/auto-paper";
|
|
1610
1607
|
import { keepAwakeReducer } from "@rific/core";
|
|
1611
|
-
import {
|
|
1608
|
+
import { hapticReducer, soundReducer } from "@rific/feedback-press";
|
|
1612
1609
|
import { profilesReducer } from "@tastic/profile";
|
|
1613
|
-
var initialSoundSettings = { ...defaultSoundSettings, enabled: !__DEV__ };
|
|
1614
|
-
var appSoundReducer = (state = initialSoundSettings, action) => soundReducer(state, action);
|
|
1615
1610
|
function createShellReducers({ seatColors, appearance = "system", seatTheme }) {
|
|
1616
1611
|
return {
|
|
1617
1612
|
// Explicit primary/secondary triad (rather than a single seed expanded via harmony) so the pack's
|
|
@@ -1625,7 +1620,9 @@ function createShellReducers({ seatColors, appearance = "system", seatTheme }) {
|
|
|
1625
1620
|
// only when the pack's appearance is; hooks/useSeatColors.ts re-applies it with the live mode).
|
|
1626
1621
|
theme: createThemeReducer(seatTheme ? { appearance, ...seatTheme(seatColors, appearance === "dark") } : { appearance, color: { primary: seatColors[1], secondary: seatColors[2], tertiary: getThirdColor2(seatColors[1], seatColors[2]) } }),
|
|
1627
1622
|
haptic: hapticReducer,
|
|
1628
|
-
|
|
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,
|
|
1629
1626
|
// @rific/core's Keep Awake setting (see Providers.tsx's KeepAwakeBridge), under the namespace its
|
|
1630
1627
|
// REHYDRATE handling expects.
|
|
1631
1628
|
keepAwake: keepAwakeReducer,
|
|
@@ -1646,11 +1643,6 @@ function createShellReducers({ seatColors, appearance = "system", seatTheme }) {
|
|
|
1646
1643
|
}
|
|
1647
1644
|
|
|
1648
1645
|
// src/redux/createPackStore.ts
|
|
1649
|
-
var hasError = (action) => typeof action === "object" && action !== null && "error" in action && Boolean(action.error);
|
|
1650
|
-
var errorMiddleware = () => (next) => (action) => {
|
|
1651
|
-
if (!hasError(action)) return next(action);
|
|
1652
|
-
return action;
|
|
1653
|
-
};
|
|
1654
1646
|
function createPackStore(pack, { keyPrefix, migrate, blacklist = [], serializableIgnoredPaths = [], middleware = [] }) {
|
|
1655
1647
|
const gameReducers = Object.assign({}, ...pack.games.map((game) => game.reducers));
|
|
1656
1648
|
const resumeReducers = pack.games.some((game) => game.resumable) ? { lastActiveGame: lastActiveGameSlice_default } : {};
|
|
@@ -1683,7 +1675,7 @@ function createPackStore(pack, { keyPrefix, migrate, blacklist = [], serializabl
|
|
|
1683
1675
|
ignoredPaths: [...serializableIgnoredPaths]
|
|
1684
1676
|
}
|
|
1685
1677
|
});
|
|
1686
|
-
return defaultMiddleware.concat(
|
|
1678
|
+
return defaultMiddleware.concat(...middleware);
|
|
1687
1679
|
},
|
|
1688
1680
|
reducer: persistedReducer
|
|
1689
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.2.
|
|
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",
|
|
@@ -138,9 +138,10 @@
|
|
|
138
138
|
"@tastic/achievements": ">=0.6.0",
|
|
139
139
|
"@tastic/core": ">=0.16.0",
|
|
140
140
|
"@tastic/edge-guard": ">=0.2.0",
|
|
141
|
-
"@tastic/hud": ">=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
|
@@ -3,7 +3,7 @@ import { useHapticSettings } from '@rific/feedback-press'
|
|
|
3
3
|
import { Toaster, ToastProvider } from '@rific/toaster'
|
|
4
4
|
import { useThemedRootBackground } from '@tastic/core'
|
|
5
5
|
import { edgeGuardScreenOptions } from '@tastic/edge-guard'
|
|
6
|
-
import {
|
|
6
|
+
import { ScreenFrame } from '@tastic/hud/chrome'
|
|
7
7
|
import { ProfileColorProvider } from '@tastic/profile'
|
|
8
8
|
import * as Haptics from 'expo-haptics'
|
|
9
9
|
import { DarkTheme, DefaultTheme, Stack, ThemeProvider as NavigationThemeProvider } from 'expo-router'
|
|
@@ -152,28 +152,20 @@ function HapticGatedToastProvider({ children }: { children: ReactNode }) {
|
|
|
152
152
|
)
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
function
|
|
156
|
-
const renderFrame = useCallback(
|
|
157
|
-
(toasts: ReactNode) => (
|
|
158
|
-
<RotatedFrame rotatedSafeArea passThrough>
|
|
159
|
-
{toasts}
|
|
160
|
-
</RotatedFrame>
|
|
161
|
-
),
|
|
162
|
-
[]
|
|
163
|
-
)
|
|
155
|
+
function FramedToaster() {
|
|
156
|
+
const renderFrame = useCallback((toasts: ReactNode) => <ScreenFrame passThrough>{toasts}</ScreenFrame>, [])
|
|
164
157
|
return <Toaster historyButton={null} clearButton={null} limit={3} renderFrame={renderFrame} />
|
|
165
158
|
}
|
|
166
159
|
|
|
167
|
-
// The pack's own toaster (PackDefinition.Toaster), laid over the whole app in hud's
|
|
168
|
-
//
|
|
169
|
-
//
|
|
170
|
-
// 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.
|
|
171
163
|
function PackToaster({ Toaster: PackToasterComponent }: { Toaster: NonNullable<PackDefinition['Toaster']> }) {
|
|
172
164
|
return (
|
|
173
165
|
<View style={StyleSheet.absoluteFill} pointerEvents='box-none'>
|
|
174
|
-
<
|
|
166
|
+
<ScreenFrame passThrough>
|
|
175
167
|
<PackToasterComponent />
|
|
176
|
-
</
|
|
168
|
+
</ScreenFrame>
|
|
177
169
|
</View>
|
|
178
170
|
)
|
|
179
171
|
}
|
|
@@ -234,7 +226,7 @@ export function RootLayout({ pack, store, persistor }: RootLayoutProps) {
|
|
|
234
226
|
{/* historyButton/clearButton off: there's no toast history to open, and a
|
|
235
227
|
control row for it above the toast stack would go nowhere. limit pins the
|
|
236
228
|
package's current default (3) so a future toaster release can't change it. */}
|
|
237
|
-
{pack.Toaster ? <PackToaster Toaster={pack.Toaster} /> : <
|
|
229
|
+
{pack.Toaster ? <PackToaster Toaster={pack.Toaster} /> : <FramedToaster />}
|
|
238
230
|
<UpdateDialog />
|
|
239
231
|
</HapticGatedToastProvider>
|
|
240
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)
|
|
@@ -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
|
}
|
|
@@ -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
|