@tastic/shell 0.7.0 → 0.8.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 +2 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -2
- package/dist/index.mjs +4 -2
- package/package.json +4 -4
- package/src/components/SettingsDialog.tsx +8 -3
- package/src/types.ts +5 -0
package/README.md
CHANGED
|
@@ -102,6 +102,7 @@ the front of an in-app link, so a route starting with a game id equal to the bas
|
|
|
102
102
|
| `fonts?` | Fonts the pack's own art needs, loaded behind the splash screen beside the icon font. |
|
|
103
103
|
| `fontFamily?` | The typeface on every Paper text variant. Unset is Paper's own. |
|
|
104
104
|
| `otaVersion` | The version label in Settings. |
|
|
105
|
+
| `useSettingsRules?` | A hook returning what goes first in every Settings dialog, above the shell's rows: the rules of the game it's opened in. Null where there's nothing (Home). |
|
|
105
106
|
| `SettingsSections?` | The pack's own Settings sections, in every Settings dialog, under the shell's rows and any a play screen adds. |
|
|
106
107
|
| `reducers?` | The pack's own store keys (what `SettingsSections` saves), beside the shell's and the games'. Never a key either already mounts. |
|
|
107
108
|
| `StatsSections?` | A section across the pack's games (a calendar of play), first on the stats screen's Stats tab, handed its two filters (`PackStatsSectionsProps`: `profileId`, null for Everyone, and `gameId`, null for All Games). |
|
|
@@ -233,7 +234,7 @@ became a package (the lower of the two where they differ).
|
|
|
233
234
|
| `@rific/feedback-press` | >=0.13.1 | haptic and sound settings, the UI sounds |
|
|
234
235
|
| `@rific/toaster` | >=0.10.1 | toasts (DuelTastic runs 0.12, PuckTastic 0.10) |
|
|
235
236
|
| `@tastic/core` | >=0.15.0 | the seat mode from the window's shape, the root background |
|
|
236
|
-
| `@tastic/hud` | >=0.
|
|
237
|
+
| `@tastic/hud` | >=0.29.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 |
|
|
237
238
|
| `@tastic/profile` | >=0.16.2 | profiles, the seat buttons, seat colors |
|
|
238
239
|
| `@tastic/achievements` | >=0.6.0 | `createGameStats`, `forgetProfileAchievements` |
|
|
239
240
|
| `@tastic/split-screen` | >=0.5.5 | the 2 Player loadout's two halves |
|
package/dist/index.d.mts
CHANGED
|
@@ -280,6 +280,7 @@ interface PackDefinition {
|
|
|
280
280
|
fontFamily?: string;
|
|
281
281
|
otaVersion: number;
|
|
282
282
|
SettingsSections?: ComponentType;
|
|
283
|
+
useSettingsRules?: () => ReactNode;
|
|
283
284
|
reducers?: Record<string, Reducer>;
|
|
284
285
|
StatsSections?: ComponentType<PackStatsSectionsProps>;
|
|
285
286
|
Backdrop?: ComponentType;
|
package/dist/index.d.ts
CHANGED
|
@@ -280,6 +280,7 @@ interface PackDefinition {
|
|
|
280
280
|
fontFamily?: string;
|
|
281
281
|
otaVersion: number;
|
|
282
282
|
SettingsSections?: ComponentType;
|
|
283
|
+
useSettingsRules?: () => ReactNode;
|
|
283
284
|
reducers?: Record<string, Reducer>;
|
|
284
285
|
StatsSections?: ComponentType<PackStatsSectionsProps>;
|
|
285
286
|
Backdrop?: ComponentType;
|
package/dist/index.js
CHANGED
|
@@ -635,12 +635,14 @@ function useAppSettings() {
|
|
|
635
635
|
|
|
636
636
|
// src/components/SettingsDialog.tsx
|
|
637
637
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
638
|
+
var noSettingsRules = () => null;
|
|
638
639
|
function SettingsDialog({ visible, onDismiss, onShowHowToPlay, children }) {
|
|
639
640
|
const onUpdateError = (0, import_toaster3.useUpdateErrorToast)();
|
|
640
641
|
const { settings, setSettings } = useAppSettings();
|
|
641
|
-
const { otaVersion, SettingsSections, edgeGuard = true } = usePack();
|
|
642
|
+
const { otaVersion, SettingsSections, edgeGuard = true, useSettingsRules = noSettingsRules } = usePack();
|
|
643
|
+
const rules = useSettingsRules();
|
|
642
644
|
const edgeGuardProps = edgeGuard ? { deferBottomEdgeGestures: settings.deferBottomEdgeGestures, onDeferBottomEdgeGestures: (value) => setSettings({ deferBottomEdgeGestures: value }) } : {};
|
|
643
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_chrome3.BaseSettingsDialog, { visible, onDismiss, version: otaVersion, ...edgeGuardProps, onUpdateError, onShowHowToPlay, children: [
|
|
645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_chrome3.BaseSettingsDialog, { visible, onDismiss, version: otaVersion, ...edgeGuardProps, onUpdateError, onShowHowToPlay, leading: rules, children: [
|
|
644
646
|
children,
|
|
645
647
|
SettingsSections && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SettingsSections, {})
|
|
646
648
|
] });
|
package/dist/index.mjs
CHANGED
|
@@ -558,12 +558,14 @@ function useAppSettings() {
|
|
|
558
558
|
|
|
559
559
|
// src/components/SettingsDialog.tsx
|
|
560
560
|
import { jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
561
|
+
var noSettingsRules = () => null;
|
|
561
562
|
function SettingsDialog({ visible, onDismiss, onShowHowToPlay, children }) {
|
|
562
563
|
const onUpdateError = useUpdateErrorToast2();
|
|
563
564
|
const { settings, setSettings } = useAppSettings();
|
|
564
|
-
const { otaVersion, SettingsSections, edgeGuard = true } = usePack();
|
|
565
|
+
const { otaVersion, SettingsSections, edgeGuard = true, useSettingsRules = noSettingsRules } = usePack();
|
|
566
|
+
const rules = useSettingsRules();
|
|
565
567
|
const edgeGuardProps = edgeGuard ? { deferBottomEdgeGestures: settings.deferBottomEdgeGestures, onDeferBottomEdgeGestures: (value) => setSettings({ deferBottomEdgeGestures: value }) } : {};
|
|
566
|
-
return /* @__PURE__ */ jsxs3(BaseSettingsDialog, { visible, onDismiss, version: otaVersion, ...edgeGuardProps, onUpdateError, onShowHowToPlay, children: [
|
|
568
|
+
return /* @__PURE__ */ jsxs3(BaseSettingsDialog, { visible, onDismiss, version: otaVersion, ...edgeGuardProps, onUpdateError, onShowHowToPlay, leading: rules, children: [
|
|
567
569
|
children,
|
|
568
570
|
SettingsSections && /* @__PURE__ */ jsx11(SettingsSections, {})
|
|
569
571
|
] });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tastic/shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.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",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@expo/vector-icons": "^15.1.1",
|
|
71
71
|
"@infinitetoken/eslint-config": "^0.2.1",
|
|
72
72
|
"@infinitetoken/jest-config": "^0.5.2",
|
|
73
|
-
"@infinitetoken/tsconfig": "^0.
|
|
73
|
+
"@infinitetoken/tsconfig": "^0.7.0",
|
|
74
74
|
"@react-native-async-storage/async-storage": "2.2.0",
|
|
75
75
|
"@react-native-masked-view/masked-view": "0.3.2",
|
|
76
76
|
"@react-native/jest-preset": "^0.88.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@tastic/achievements": "^0.6.0",
|
|
87
87
|
"@tastic/core": "^0.16.0",
|
|
88
88
|
"@tastic/edge-guard": "^0.1.5",
|
|
89
|
-
"@tastic/hud": "^0.
|
|
89
|
+
"@tastic/hud": "^0.29.0",
|
|
90
90
|
"@tastic/profile": "^0.18.0",
|
|
91
91
|
"@tastic/split-screen": "^0.5.5",
|
|
92
92
|
"@testing-library/react-native": "^14.1.0",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"@tastic/achievements": ">=0.6.0",
|
|
138
138
|
"@tastic/core": ">=0.16.0",
|
|
139
139
|
"@tastic/edge-guard": ">=0.1.5",
|
|
140
|
-
"@tastic/hud": ">=0.
|
|
140
|
+
"@tastic/hud": ">=0.29.0",
|
|
141
141
|
"@tastic/profile": ">=0.18.0",
|
|
142
142
|
"@tastic/split-screen": ">=0.5.5",
|
|
143
143
|
"expo-blur": ">=58.0.4",
|
|
@@ -17,20 +17,25 @@ export interface SettingsDialogProps {
|
|
|
17
17
|
children?: ReactNode
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
// A pack without rules to put first (PackDefinition.useSettingsRules).
|
|
21
|
+
const noSettingsRules = () => null
|
|
22
|
+
|
|
20
23
|
// The pack-wide Settings dialog: everything the shell puts in it applies to every game (Edge Guard,
|
|
21
24
|
// theme, sound, haptics, Keep Awake), so it reads and writes the app
|
|
22
|
-
// settings itself.
|
|
25
|
+
// settings itself. Above those, the rules of the game it's opened in (PackDefinition.useSettingsRules);
|
|
26
|
+
// under them, a play screen's own rows and then the pack's own sections
|
|
23
27
|
// (PackDefinition.SettingsSections), in every Settings dialog the pack opens. A pack with edgeGuard
|
|
24
28
|
// false gets no Edge Guard row: hud draws it on iOS whenever its props are passed.
|
|
25
29
|
export function SettingsDialog({ visible, onDismiss, onShowHowToPlay, children }: SettingsDialogProps) {
|
|
26
30
|
const onUpdateError = useUpdateErrorToast()
|
|
27
31
|
const { settings, setSettings } = useAppSettings()
|
|
28
32
|
// The pack's otaVersion (src/constants/release.ts, which the OTA tooling bumps).
|
|
29
|
-
const { otaVersion, SettingsSections, edgeGuard = true } = usePack()
|
|
33
|
+
const { otaVersion, SettingsSections, edgeGuard = true, useSettingsRules = noSettingsRules } = usePack()
|
|
34
|
+
const rules = useSettingsRules()
|
|
30
35
|
const edgeGuardProps = edgeGuard ? { deferBottomEdgeGestures: settings.deferBottomEdgeGestures, onDeferBottomEdgeGestures: (value: boolean) => setSettings({ deferBottomEdgeGestures: value }) } : {}
|
|
31
36
|
|
|
32
37
|
return (
|
|
33
|
-
<BaseSettingsDialog visible={visible} onDismiss={onDismiss} version={otaVersion} {...edgeGuardProps} onUpdateError={onUpdateError} onShowHowToPlay={onShowHowToPlay}>
|
|
38
|
+
<BaseSettingsDialog visible={visible} onDismiss={onDismiss} version={otaVersion} {...edgeGuardProps} onUpdateError={onUpdateError} onShowHowToPlay={onShowHowToPlay} leading={rules}>
|
|
34
39
|
{children}
|
|
35
40
|
{SettingsSections && <SettingsSections />}
|
|
36
41
|
</BaseSettingsDialog>
|
package/src/types.ts
CHANGED
|
@@ -292,6 +292,11 @@ export interface PackDefinition {
|
|
|
292
292
|
// The pack's own Settings sections (how cards look, how play is helped along), in every Settings
|
|
293
293
|
// dialog under the shell's own rows and any a play screen adds. Their values live in `reducers`.
|
|
294
294
|
SettingsSections?: ComponentType
|
|
295
|
+
// What goes FIRST in every Settings dialog the pack opens, above the shell's own rows: the rules of
|
|
296
|
+
// the game the dialog is opened in (Solitaire finds it from the route), which someone opening
|
|
297
|
+
// Settings from a game is most likely there for. Null where there is nothing to put first (Home), and
|
|
298
|
+
// the dialog is then as it was. A hook, called on every render of the dialog.
|
|
299
|
+
useSettingsRules?: () => ReactNode
|
|
295
300
|
// Store keys of the pack's own, beside the shell's and each game's (GameDefinition.reducers): what
|
|
296
301
|
// SettingsSections saves, or anything else that belongs to every game. Never a key the shell or a
|
|
297
302
|
// game already mounts.
|