@tastic/shell 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -9
- package/dist/index.d.mts +11 -7
- package/dist/index.d.ts +11 -7
- package/dist/index.js +197 -177
- package/dist/index.mjs +129 -110
- package/package.json +5 -5
- package/src/RootLayout.tsx +1 -1
- package/src/components/SettingsDialog.tsx +13 -2
- package/src/index.ts +1 -0
- package/src/routes.ts +3 -1
- package/src/screens/EditProfileRoute.tsx +31 -0
- package/src/screens/HomeScreen.tsx +1 -1
- package/src/screens/LoadoutScreen.tsx +1 -1
- package/src/screens/ProfilesRoute.tsx +16 -24
- package/src/types.ts +13 -8
package/README.md
CHANGED
|
@@ -26,7 +26,8 @@ package ecosystem, on [`@tastic/hud`](https://github.com/jayrdeaton/react-native
|
|
|
26
26
|
navigation theme's background (what shows in a sliding screen's corners during a push or pop).
|
|
27
27
|
- **Screens** for the routes: `HomeScreen` (the pack's hero, seat 1's button, a row per game, or a
|
|
28
28
|
grid of preview tiles on a wide screen, split into tabs where the pack has them), `LoadoutRoute` and `PlayRoute` (`loadout/[game]`,
|
|
29
|
-
`play/[game]`), `ProfilesRoute`
|
|
29
|
+
`play/[game]`), `ProfilesRoute`, `EditProfileRoute` (`profile/[id]`, one profile's Edit Profile
|
|
30
|
+
screen, which Profiles pushes with the profile's id or `new`) and `StatsScreen`.
|
|
30
31
|
- **The store**: `createPackStore(pack, { keyPrefix, migrate, blacklist, serializableIgnoredPaths,
|
|
31
32
|
middleware })` builds one persisted store from the shell's keys (theme, haptics, sound, Keep Awake,
|
|
32
33
|
profiles, seat selection, seat colors, app settings, seat 2, the never-saved `liveplay`, and
|
|
@@ -75,7 +76,7 @@ export const pack: PackDefinition = {
|
|
|
75
76
|
export const { store, persistor } = createPackStore(pack, { keyPrefix: 'dueltastic:' })
|
|
76
77
|
```
|
|
77
78
|
|
|
78
|
-
and `src/app/` holds
|
|
79
|
+
and `src/app/` holds seven thin routes:
|
|
79
80
|
|
|
80
81
|
```tsx
|
|
81
82
|
// _layout.tsx
|
|
@@ -83,8 +84,8 @@ export default function Layout() {
|
|
|
83
84
|
return <RootLayout pack={pack} store={store} persistor={persistor} />
|
|
84
85
|
}
|
|
85
86
|
|
|
86
|
-
// index.tsx, profiles.tsx, stats.tsx
|
|
87
|
-
export default HomeScreen // ProfilesRoute, StatsScreen
|
|
87
|
+
// index.tsx, profiles.tsx, profile/[id].tsx, stats.tsx
|
|
88
|
+
export default HomeScreen // ProfilesRoute, EditProfileRoute, StatsScreen
|
|
88
89
|
|
|
89
90
|
// loadout/[game].tsx and play/[game].tsx (PlayRoute): the web build is a static export
|
|
90
91
|
export function generateStaticParams() {
|
|
@@ -138,8 +139,9 @@ PuckTastic and DuelTastic draw what they always did:
|
|
|
138
139
|
| `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. |
|
|
139
140
|
| `resetStats?` | The stats screen's Reset where the pack resets stats itself (`PackStatsReset`: a `useReset` hook returning `(profileId) => void`, and the `labels` for a player's name, Guest, or `null` for Everyone). It follows the player picker, not the game picker. |
|
|
140
141
|
| `statsGameTitles?` | `false` leaves each game's name off its sections on All Games, where the sections name it. |
|
|
141
|
-
| `newProfileColor?` | A new profile's starting color on
|
|
142
|
-
| `
|
|
142
|
+
| `newProfileColor?` | A new profile's starting color on its Edit Profile screen. Unset is auto-paper's first swatch. |
|
|
143
|
+
| `ProfileSections?` | `ComponentType<{ profile }>`: the pack's own sections on a saved profile's Edit Profile screen, under Color and above Delete Profile, drawn with `@tastic/profile`'s `EditProfileSection` and `EditProfileRow`. A pack with online play puts its `ProfileOnlineSection` (`@tastic/profile/online`) there. |
|
|
144
|
+
| `usePickerAlign?` | `(open, contentWidth, contentHeight) => AlignResult` (`PickerAlign`), a hook: where seat 1's menu on Home, both seat buttons' menus in a loadout's one-human row (2 Player keeps each menu in its own player's half) and the stats screen's two pickers open. It was added because hud's own placement measured a button in a frame turned by `@tastic/core`'s drawn rotation against the upright window (Solitaire's `useFrameAutoAlign`); nothing turns since core 0.15, so a pack may no longer need one. (A profile's color swatch used it too, until the swatches moved onto the Edit Profile screen.) Unset is hud's placement. |
|
|
143
145
|
| `resumeHref?` | `(gameId) => Href \| null`: where a cold launch goes back into a resumable game, for a pack with more than one way to be playing it. Null, or unset, is the game's play screen. |
|
|
144
146
|
| `homePlayerPicker?` | `false` leaves seat 1's button off Home, for a pack whose every game opens a loadout, where the player is picked anyway. |
|
|
145
147
|
| `homeTabs?` | Tabs splitting Home's games (`HomeTab`: a `label`, and `includes(game)`, which of the pack's games it shows, in the pack's order): a switch under seat 1's button, or over the grid on a wide screen, on the theme's surface over a `Backdrop`, showing one tab's games at a time. It opens on the first tab and keeps the one picked while Home is covered or the window changes. The other tabs' games stay mounted, hidden, so a switch draws nothing new. A game no tab includes isn't on Home. Unset, or a single tab, shows every game with no switch. Solitaire's: Solitaire (no `seatTwo`) and Two Player. |
|
|
@@ -293,7 +295,9 @@ actions and defaults are exported for a pack's own code and its tests.
|
|
|
293
295
|
`humanSeatsFor(mode)`: the seats that press Ready, `[1, 2]` in 2 Player and `[1]` otherwise.
|
|
294
296
|
`seatTwoFor(saved, choices)`: seat 2's saved choice as one game reads it (see `GameDefinition`).
|
|
295
297
|
- `SettingsDialog` (`SettingsDialogProps`): `visible`, `onDismiss`, `onShowHowToPlay` (optional: shows
|
|
296
|
-
the How to Play row, as a loadout does; left out on Home and in a match)
|
|
298
|
+
the How to Play row, as a loadout does; left out on Home and in a match), `showProfile` (optional:
|
|
299
|
+
the Profile row, "Profile" over seat 1's name, opening its Edit Profile screen, or Profiles while
|
|
300
|
+
seat 1 is Guest; Home and a loadout show it, a play screen leaves it off) and `children` (a play
|
|
297
301
|
screen's own rows). The pack's `useSettingsRules` goes above the shell's rows, and `children` and
|
|
298
302
|
then the pack's `SettingsSections` under them.
|
|
299
303
|
- `safeBack()`: back, or Home (`/`) where there's nothing to go back to.
|
|
@@ -395,8 +399,8 @@ what the shell started using (noted in the table).
|
|
|
395
399
|
| `@rific/feedback-press` | >=0.13.1 | haptic and sound settings, the UI sounds |
|
|
396
400
|
| `@rific/toaster` | >=0.10.1 | toasts |
|
|
397
401
|
| `@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`) |
|
|
398
|
-
| `@tastic/hud` | >=0.
|
|
399
|
-
| `@tastic/profile` | >=0.
|
|
402
|
+
| `@tastic/hud` | >=0.37.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, Edit Profile and the toaster (0.34.0, where `RotatedFrame` became `ScreenFrame`), a pack's lettering (0.35.0's `LetteringProvider`), Settings' Profile row (0.37.0's `profilesRow`) |
|
|
403
|
+
| `@tastic/profile` | >=0.25.0 | profiles and the shared roster, the seat buttons, seat colors, the dividers in player 1's opponent menu (0.18.0's `dividerBefore`), and each profile's Edit Profile screen (0.22.0's `EditProfileScreen`, behind `EditProfileRoute`, with a pack's sections from 0.25.0) |
|
|
400
404
|
| `@tastic/achievements` | >=0.6.0 | `createGameStats`, `forgetProfileAchievements` |
|
|
401
405
|
| `@tastic/split-screen` | >=0.5.5 | the 2 Player loadout's two halves |
|
|
402
406
|
| `@tastic/edge-guard` | >=0.2.0 | Edge Guard during play (`useEdgeGestureGuard` on iOS, `edgeGuardScreenOptions` on Android) |
|
package/dist/index.d.mts
CHANGED
|
@@ -5,6 +5,8 @@ import { ThemeAppearance, ThemeSettings } from '@rific/auto-paper';
|
|
|
5
5
|
import { PopoverHost, AlignResult } from '@tastic/hud/chrome';
|
|
6
6
|
import { GuideStep } from '@tastic/hud/guide';
|
|
7
7
|
import { MenuOption } from '@tastic/hud/lobby';
|
|
8
|
+
import * as _tastic_profile from '@tastic/profile';
|
|
9
|
+
import { profilesReducer, Profile, CreateProfileInput, SeatColorsState as SeatColorsState$1 } from '@tastic/profile';
|
|
8
10
|
import { FontSource } from 'expo-font';
|
|
9
11
|
import { Href, Stack } from 'expo-router';
|
|
10
12
|
import { TextStyle, ImageSourcePropType } from 'react-native';
|
|
@@ -12,8 +14,6 @@ import * as redux from 'redux';
|
|
|
12
14
|
import { Reducer, Action } from 'redux';
|
|
13
15
|
import * as _rific_core from '@rific/core';
|
|
14
16
|
export { safeBack } from '@rific/core';
|
|
15
|
-
import * as _tastic_profile from '@tastic/profile';
|
|
16
|
-
import { profilesReducer, Profile, CreateProfileInput, SeatColorsState as SeatColorsState$1 } from '@tastic/profile';
|
|
17
17
|
import * as _rific_feedback_press from '@rific/feedback-press';
|
|
18
18
|
import * as redux_persist from 'redux-persist';
|
|
19
19
|
import { PersistedState, Persistor } from 'redux-persist';
|
|
@@ -309,11 +309,12 @@ interface PackDefinition {
|
|
|
309
309
|
resetStats?: PackStatsReset;
|
|
310
310
|
statsGameTitles?: boolean;
|
|
311
311
|
newProfileColor?: string;
|
|
312
|
+
ProfileSections?: ComponentType<{
|
|
313
|
+
profile: Profile;
|
|
314
|
+
}>;
|
|
312
315
|
usePickerAlign?: PickerAlign;
|
|
313
316
|
}
|
|
314
|
-
type PickerAlign = (open: boolean, contentWidth: number, contentHeight: number
|
|
315
|
-
maxContentWidth?: number;
|
|
316
|
-
}) => AlignResult;
|
|
317
|
+
type PickerAlign = (open: boolean, contentWidth: number, contentHeight: number) => AlignResult;
|
|
317
318
|
|
|
318
319
|
declare function PackProvider({ pack, children }: {
|
|
319
320
|
pack: PackDefinition;
|
|
@@ -379,6 +380,8 @@ interface RootLayoutProps {
|
|
|
379
380
|
}
|
|
380
381
|
declare function RootLayout({ pack, store, persistor }: RootLayoutProps): react.JSX.Element;
|
|
381
382
|
|
|
383
|
+
declare function EditProfileRoute(): react.JSX.Element;
|
|
384
|
+
|
|
382
385
|
declare function LoadoutRoute(): react.JSX.Element;
|
|
383
386
|
declare function PlayRoute(): react.JSX.Element;
|
|
384
387
|
|
|
@@ -431,9 +434,10 @@ interface SettingsDialogProps {
|
|
|
431
434
|
visible: boolean;
|
|
432
435
|
onDismiss: () => void;
|
|
433
436
|
onShowHowToPlay?: () => void;
|
|
437
|
+
showProfile?: boolean;
|
|
434
438
|
children?: ReactNode;
|
|
435
439
|
}
|
|
436
|
-
declare function SettingsDialog({ visible, onDismiss, onShowHowToPlay, children }: SettingsDialogProps): react.JSX.Element;
|
|
440
|
+
declare function SettingsDialog({ visible, onDismiss, onShowHowToPlay, showProfile, children }: SettingsDialogProps): react.JSX.Element;
|
|
437
441
|
|
|
438
442
|
declare function useActiveRound<S extends object>(game: string, defaults: S): {
|
|
439
443
|
mode: RoundMode;
|
|
@@ -583,5 +587,5 @@ declare function createPlayerSettings<S extends WithControls<C>, C>({ id, defaul
|
|
|
583
587
|
};
|
|
584
588
|
};
|
|
585
589
|
|
|
586
|
-
export { DEFAULT_APP_SETTINGS, DEFAULT_OPPONENT, GUEST_PLAYER_ID, HomeScreen, LoadoutRoute, MATCH_CHIPS_FADE_MS, MatchChips, PREVIEW_ASPECT, PackProvider, PlayRoute, ProfilesProvider, ProfilesRoute, RootLayout, SettingsDialog, StatsScreen, appSettingsActions, reducer$1 as appSettingsReducer, createGameGuideSlice, createGameStats, createPackStore, createPlayerSettings, createSeatColorsReducer, createShellReducers, defaultProfileSelectionState, defaultSeatColorsState, forgetProfileAchievements, humanSeatsFor, imageGameIcon, liveplayActions, reducer$3 as liveplayReducer, onProfileRemoved, opponentActions, reducer$2 as opponentReducer, profileSelectionActions, reducer as profileSelectionReducer, roundModeFor, seatColorsActions, seatPlayerKey, seatTwoFor, useActiveRound, useAppSettings, useAtComputer, useBackBlock, useGameGuide, useOpponent, usePack, usePackGame, useProfiles, useSeatColors };
|
|
590
|
+
export { DEFAULT_APP_SETTINGS, DEFAULT_OPPONENT, EditProfileRoute, GUEST_PLAYER_ID, HomeScreen, LoadoutRoute, MATCH_CHIPS_FADE_MS, MatchChips, PREVIEW_ASPECT, PackProvider, PlayRoute, ProfilesProvider, ProfilesRoute, RootLayout, SettingsDialog, StatsScreen, appSettingsActions, reducer$1 as appSettingsReducer, createGameGuideSlice, createGameStats, createPackStore, createPlayerSettings, createSeatColorsReducer, createShellReducers, defaultProfileSelectionState, defaultSeatColorsState, forgetProfileAchievements, humanSeatsFor, imageGameIcon, liveplayActions, reducer$3 as liveplayReducer, onProfileRemoved, opponentActions, reducer$2 as opponentReducer, profileSelectionActions, reducer as profileSelectionReducer, roundModeFor, seatColorsActions, seatPlayerKey, seatTwoFor, useActiveRound, useAppSettings, useAtComputer, useBackBlock, useGameGuide, useOpponent, usePack, usePackGame, useProfiles, useSeatColors };
|
|
587
591
|
export type { ActiveRound, AppSettings, FeedbackSounds, GameDefinition, GameGuide, GameGuideState, GameIconProps, GameLoadout, GamePreviewProps, GameRulesProps, GuidelessGameDefinition, HeroTitleProps, HomeTab, LiveplaySliceState, LoadoutOptionsProps, MatchChipsProps, OpponentState, PackDefinition, PackGameDefinition, PackGuide, PackStatsReset, PackStatsSectionsProps, PackStatsTab, PackStore, PackStoreConfig, PackStoreSource, PickerAlign, PlayerControlsState, PlayerSettingsState, ProfileSelectionState, RecordResult, RoundMode, Seat, SeatColorsState, SeatControlLook, SeatTwo, SettingsDialogProps, ShellState, StackScreenOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ import { ThemeAppearance, ThemeSettings } from '@rific/auto-paper';
|
|
|
5
5
|
import { PopoverHost, AlignResult } from '@tastic/hud/chrome';
|
|
6
6
|
import { GuideStep } from '@tastic/hud/guide';
|
|
7
7
|
import { MenuOption } from '@tastic/hud/lobby';
|
|
8
|
+
import * as _tastic_profile from '@tastic/profile';
|
|
9
|
+
import { profilesReducer, Profile, CreateProfileInput, SeatColorsState as SeatColorsState$1 } from '@tastic/profile';
|
|
8
10
|
import { FontSource } from 'expo-font';
|
|
9
11
|
import { Href, Stack } from 'expo-router';
|
|
10
12
|
import { TextStyle, ImageSourcePropType } from 'react-native';
|
|
@@ -12,8 +14,6 @@ import * as redux from 'redux';
|
|
|
12
14
|
import { Reducer, Action } from 'redux';
|
|
13
15
|
import * as _rific_core from '@rific/core';
|
|
14
16
|
export { safeBack } from '@rific/core';
|
|
15
|
-
import * as _tastic_profile from '@tastic/profile';
|
|
16
|
-
import { profilesReducer, Profile, CreateProfileInput, SeatColorsState as SeatColorsState$1 } from '@tastic/profile';
|
|
17
17
|
import * as _rific_feedback_press from '@rific/feedback-press';
|
|
18
18
|
import * as redux_persist from 'redux-persist';
|
|
19
19
|
import { PersistedState, Persistor } from 'redux-persist';
|
|
@@ -309,11 +309,12 @@ interface PackDefinition {
|
|
|
309
309
|
resetStats?: PackStatsReset;
|
|
310
310
|
statsGameTitles?: boolean;
|
|
311
311
|
newProfileColor?: string;
|
|
312
|
+
ProfileSections?: ComponentType<{
|
|
313
|
+
profile: Profile;
|
|
314
|
+
}>;
|
|
312
315
|
usePickerAlign?: PickerAlign;
|
|
313
316
|
}
|
|
314
|
-
type PickerAlign = (open: boolean, contentWidth: number, contentHeight: number
|
|
315
|
-
maxContentWidth?: number;
|
|
316
|
-
}) => AlignResult;
|
|
317
|
+
type PickerAlign = (open: boolean, contentWidth: number, contentHeight: number) => AlignResult;
|
|
317
318
|
|
|
318
319
|
declare function PackProvider({ pack, children }: {
|
|
319
320
|
pack: PackDefinition;
|
|
@@ -379,6 +380,8 @@ interface RootLayoutProps {
|
|
|
379
380
|
}
|
|
380
381
|
declare function RootLayout({ pack, store, persistor }: RootLayoutProps): react.JSX.Element;
|
|
381
382
|
|
|
383
|
+
declare function EditProfileRoute(): react.JSX.Element;
|
|
384
|
+
|
|
382
385
|
declare function LoadoutRoute(): react.JSX.Element;
|
|
383
386
|
declare function PlayRoute(): react.JSX.Element;
|
|
384
387
|
|
|
@@ -431,9 +434,10 @@ interface SettingsDialogProps {
|
|
|
431
434
|
visible: boolean;
|
|
432
435
|
onDismiss: () => void;
|
|
433
436
|
onShowHowToPlay?: () => void;
|
|
437
|
+
showProfile?: boolean;
|
|
434
438
|
children?: ReactNode;
|
|
435
439
|
}
|
|
436
|
-
declare function SettingsDialog({ visible, onDismiss, onShowHowToPlay, children }: SettingsDialogProps): react.JSX.Element;
|
|
440
|
+
declare function SettingsDialog({ visible, onDismiss, onShowHowToPlay, showProfile, children }: SettingsDialogProps): react.JSX.Element;
|
|
437
441
|
|
|
438
442
|
declare function useActiveRound<S extends object>(game: string, defaults: S): {
|
|
439
443
|
mode: RoundMode;
|
|
@@ -583,5 +587,5 @@ declare function createPlayerSettings<S extends WithControls<C>, C>({ id, defaul
|
|
|
583
587
|
};
|
|
584
588
|
};
|
|
585
589
|
|
|
586
|
-
export { DEFAULT_APP_SETTINGS, DEFAULT_OPPONENT, GUEST_PLAYER_ID, HomeScreen, LoadoutRoute, MATCH_CHIPS_FADE_MS, MatchChips, PREVIEW_ASPECT, PackProvider, PlayRoute, ProfilesProvider, ProfilesRoute, RootLayout, SettingsDialog, StatsScreen, appSettingsActions, reducer$1 as appSettingsReducer, createGameGuideSlice, createGameStats, createPackStore, createPlayerSettings, createSeatColorsReducer, createShellReducers, defaultProfileSelectionState, defaultSeatColorsState, forgetProfileAchievements, humanSeatsFor, imageGameIcon, liveplayActions, reducer$3 as liveplayReducer, onProfileRemoved, opponentActions, reducer$2 as opponentReducer, profileSelectionActions, reducer as profileSelectionReducer, roundModeFor, seatColorsActions, seatPlayerKey, seatTwoFor, useActiveRound, useAppSettings, useAtComputer, useBackBlock, useGameGuide, useOpponent, usePack, usePackGame, useProfiles, useSeatColors };
|
|
590
|
+
export { DEFAULT_APP_SETTINGS, DEFAULT_OPPONENT, EditProfileRoute, GUEST_PLAYER_ID, HomeScreen, LoadoutRoute, MATCH_CHIPS_FADE_MS, MatchChips, PREVIEW_ASPECT, PackProvider, PlayRoute, ProfilesProvider, ProfilesRoute, RootLayout, SettingsDialog, StatsScreen, appSettingsActions, reducer$1 as appSettingsReducer, createGameGuideSlice, createGameStats, createPackStore, createPlayerSettings, createSeatColorsReducer, createShellReducers, defaultProfileSelectionState, defaultSeatColorsState, forgetProfileAchievements, humanSeatsFor, imageGameIcon, liveplayActions, reducer$3 as liveplayReducer, onProfileRemoved, opponentActions, reducer$2 as opponentReducer, profileSelectionActions, reducer as profileSelectionReducer, roundModeFor, seatColorsActions, seatPlayerKey, seatTwoFor, useActiveRound, useAppSettings, useAtComputer, useBackBlock, useGameGuide, useOpponent, usePack, usePackGame, useProfiles, useSeatColors };
|
|
587
591
|
export type { ActiveRound, AppSettings, FeedbackSounds, GameDefinition, GameGuide, GameGuideState, GameIconProps, GameLoadout, GamePreviewProps, GameRulesProps, GuidelessGameDefinition, HeroTitleProps, HomeTab, LiveplaySliceState, LoadoutOptionsProps, MatchChipsProps, OpponentState, PackDefinition, PackGameDefinition, PackGuide, PackStatsReset, PackStatsSectionsProps, PackStatsTab, PackStore, PackStoreConfig, PackStoreSource, PickerAlign, PlayerControlsState, PlayerSettingsState, ProfileSelectionState, RecordResult, RoundMode, Seat, SeatColorsState, SeatControlLook, SeatTwo, SettingsDialogProps, ShellState, StackScreenOptions };
|