@tastic/hud 0.25.1 → 0.26.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 CHANGED
@@ -662,8 +662,9 @@ their props types:
662
662
 
663
663
  The popovers are here for `@tastic/profile`: from 0.16 its `ProfilePicker`, `ProfilesScreen` and the rest
664
664
  import them (and `ConfirmDialog`) from this entry instead of the main barrel, so a Skia-free app can use
665
- them. That's why `@tastic/profile` 0.16 needs hud 0.23.0 or later. `useZoneClampedAlign` (it needs `@tastic/split-screen`), `SectionedDropdown` (its trigger gauge
666
- loads Skia) and `PlayerSetupPanel` (it renders `@tastic/profile`'s pickers) stay main-entry only.
665
+ them. That's why `@tastic/profile` 0.16 needs hud 0.23.0 or later. `useZoneClampedAlign` (it needs `@tastic/split-screen`) and
666
+ `PlayerSetupPanel` (it renders `@tastic/profile`'s pickers) are in `@tastic/hud/lobby` (below), and
667
+ `SectionedDropdown` (its trigger gauge loads Skia) stays main-entry only.
667
668
 
668
669
  Each is the same component the main entry exports and is documented above. Only the import path changes:
669
670
 
@@ -683,6 +684,31 @@ type-checks hud's source and needs it installed. `AchievementUnlockList` isn't h
683
684
  Metro resolves both entries to the same source files, so an app that imports some components from here and
684
685
  others from `@tastic/hud` still bundles each module once.
685
686
 
687
+ ## A loadout without Skia (`@tastic/hud/lobby`)
688
+
689
+ The pieces a two-seat loadout or lobby screen is built from, from a standalone entry that never touches the
690
+ main barrel (whose `TriggerGaugeHost` and `loadSkiaWeb` reach Skia). It's for an app that has `@tastic/profile`
691
+ and `@tastic/split-screen` but no Skia: `@tastic/shell` loads its loadout through here, so a pack with no Skia
692
+ (CardTastic) can install the shell. It exports, with their props types:
693
+
694
+ - `PlayerSetupPanel` (and `getColorPopoverId`, `getProfilePopoverId`, `getCpuDifficultyPopoverId`)
695
+ - `ReadyButton`, `SharedActionBand`, `useZoneClampedAlign`
696
+ - the `MenuOption` type (the shape a CPU's difficulty menu is built from)
697
+
698
+ ```tsx
699
+ import { PlayerSetupPanel, ReadyButton, SharedActionBand } from '@tastic/hud/lobby'
700
+ import { PressAwayOverlay, usePopoverHost } from '@tastic/hud/chrome'
701
+ ```
702
+
703
+ It pulls in `react`, `react-native`, `react-native-paper`, `react-native-reanimated`,
704
+ `react-native-safe-area-context`, `@rific/auto-paper`, `@rific/feedback-press`, `@tastic/core`,
705
+ `@tastic/profile` and `@tastic/split-screen`, none of which loads Skia.
706
+ `SectionedDropdown` and `ControlSchemePicker` stay main-entry only: their trigger gauge loads Skia. A test
707
+ (`src/__tests__/lobbyImports.test.ts`) walks the import graph from `src/lobby/index.ts` and fails if anything
708
+ it reaches imports another package, reaches the main barrel or a Skia module, or has a `.web` twin, and if the
709
+ installed `@tastic/profile` or `@tastic/split-screen` imports Skia or the bare `@tastic/hud`. Each piece is
710
+ the same one the main entry exports, so Metro bundles it once whichever entry an app imports it from.
711
+
686
712
  ## Skia on web (`@tastic/hud/skia`)
687
713
 
688
714
  On web, Skia draws through CanvasKit, a WASM file fetched at runtime. `@shopify/react-native-skia` builds
@@ -764,8 +790,9 @@ when no rotation applies.
764
790
 
765
791
  None of these are bundled, so use whatever versions your app already has. Six are marked `optional` in
766
792
  `peerDependenciesMeta` so a light app can install hud without the ones it doesn't use: `./guide` needs
767
- none of the six, and `./chrome` needs only `@tastic/core` and `@rific/updater` (plus
768
- `@tastic/achievements` to type-check, see above). **npm does not install optional peers for you**, so an app that imports the
793
+ none of the six, `./chrome` needs only `@tastic/core` and `@rific/updater` (plus
794
+ `@tastic/achievements` to type-check, see above), and `./lobby` needs `@tastic/core`, `@tastic/profile` and
795
+ `@tastic/split-screen` but never Skia. **npm does not install optional peers for you**, so an app that imports the
769
796
  main `@tastic/hud` entry must list every peer that entry loads in its own `dependencies`, including
770
797
  the four optional ones marked "main entry" below. Without them, Metro fails to bundle with "Unable to
771
798
  resolve module".
@@ -773,15 +800,15 @@ resolve module".
773
800
  | Peer | Floor | Needed by |
774
801
  | --- | --- | --- |
775
802
  | `react`, `react-native` | >=19.0.0, >=0.76.0 | every entry |
776
- | `react-native-paper` | >=5.0.0 | main entry, `./guide`, `./chrome` |
803
+ | `react-native-paper` | >=5.0.0 | main entry, `./guide`, `./chrome`, `./lobby` |
777
804
  | `react-native-reanimated` | >=3.0.0 | main entry (`StaggeredWord`), `./guide`, `./chrome` (`StaggeredWord`) |
778
- | `@rific/auto-paper` | >=0.12.2 | main entry (`BaseSettingsDialog` needs the nested `Portal.Host` first shipped in 0.12.2; `OverlayCard` uses `BlurView` and `useBlur`, and `BaseSettingsDialog`'s Blur row uses `useBlurModule` and `useThemeSettings`, all in 0.12.2), `./guide`, `./chrome` |
779
- | `@rific/feedback-press` | >=0.10.2 | main entry (`useSoundSettings` first shipped in 0.10.2), `./guide`, `./chrome` |
805
+ | `@rific/auto-paper` | >=0.12.2 | main entry (`BaseSettingsDialog` needs the nested `Portal.Host` first shipped in 0.12.2; `OverlayCard` uses `BlurView` and `useBlur`, and `BaseSettingsDialog`'s Blur row uses `useBlurModule` and `useThemeSettings`, all in 0.12.2), `./guide`, `./chrome`, `./lobby` |
806
+ | `@rific/feedback-press` | >=0.10.2 | main entry (`useSoundSettings` first shipped in 0.10.2), `./guide`, `./chrome`, `./lobby` |
780
807
  | `@rific/core` | >=0.4.0 | main entry and `./chrome`: `BaseSettingsDialog`'s Keep Awake row (`useKeepAwakeSettings`, `useExpoKeepAwake`, first shipped in 0.4.0) |
781
- | `react-native-safe-area-context` | >=5.0.0 | main entry (`useZoneClampedAlign`), `./chrome` (`RotatedFrame`, `BaseSettingsDialog`) |
782
- | `@tastic/core` | >=0.12.0, optional | main entry: `useRotation()` and most dialogs; `RotatedFrame` and `BaseSettingsDialog` need `FakeLandscapeView`'s `rotation`/`passThrough`, first shipped in 0.12.0; `./chrome` (the same dialogs, and `InlineColorPicker`) |
808
+ | `react-native-safe-area-context` | >=5.0.0 | main entry and `./lobby` (`useZoneClampedAlign`), `./chrome` (`RotatedFrame`, `BaseSettingsDialog`) |
809
+ | `@tastic/core` | >=0.12.0, optional | main entry: `useRotation()` and most dialogs; `RotatedFrame` and `BaseSettingsDialog` need `FakeLandscapeView`'s `rotation`/`passThrough`, first shipped in 0.12.0; `./chrome` (the same dialogs, and `InlineColorPicker`); `./lobby` (`PlayerSetupPanel`'s color picker) |
783
810
  | `@rific/updater` | >=0.4.0, optional | main entry and `./chrome`: `BaseSettingsDialog`, `UpdateDialog` |
784
- | `@tastic/profile` | >=0.4.0, optional | main entry: `PlayerSetupPanel`, `AchievementUnlockList` (`ProfileChip`) |
785
- | `@tastic/split-screen` | >=0.5.0, optional | main entry: `useZoneClampedAlign` |
811
+ | `@tastic/profile` | >=0.4.0, optional | main entry: `PlayerSetupPanel`, `AchievementUnlockList` (`ProfileChip`); `./lobby` (`PlayerSetupPanel`) |
812
+ | `@tastic/split-screen` | >=0.5.0, optional | main entry and `./lobby`: `useZoneClampedAlign` |
786
813
  | `@shopify/react-native-skia` | >=2.6.0, optional | `TriggerGaugeHost`'s gauge (loaded when one mounts) and `./skia` |
787
814
  | `@tastic/achievements` | >=0.2.0, optional | `AchievementCatalogSection`, `AchievementUnlockList`, type-only (`AchievementCatalogRow`, first exported in 0.2.0; `AchievementTier`); `./chrome` needs it installed only to type-check |
@@ -1,9 +1,11 @@
1
1
  import * as react from 'react';
2
- import { ReactNode, RefObject, ComponentRef } from 'react';
2
+ import { ReactNode, RefObject } from 'react';
3
3
  import { AchievementCatalogRow } from '@tastic/achievements';
4
4
  import { ViewRotation } from '@tastic/core';
5
- import { Insets, StyleProp, ViewStyle, View, LayoutChangeEvent, TextStyle } from 'react-native';
5
+ import { Insets, StyleProp, ViewStyle, LayoutChangeEvent, TextStyle } from 'react-native';
6
6
  import { SeedColor } from '@rific/auto-paper';
7
+ import { P as PopoverHost, A as AlignResult, a as PopoverRotation, V as ViewInstance } from '../usePopoverHost-T8QWb2_A.mjs';
8
+ export { b as PopoverAlign, c as PopoverVerticalAlign, u as useAutoAlign, d as usePopoverHost } from '../usePopoverHost-T8QWb2_A.mjs';
7
9
  import { ButtonProps } from '@rific/feedback-press';
8
10
 
9
11
  interface Props$a {
@@ -138,26 +140,6 @@ declare function DialogHeader({ icon, title, color, compact, style }: DialogHead
138
140
 
139
141
  declare const MONO_FONT: string;
140
142
 
141
- type PopoverAlign = 'left' | 'right' | 'center';
142
- type PopoverVerticalAlign = 'below' | 'above';
143
- type PopoverRotation = ViewRotation;
144
- interface AlignResult {
145
- align: PopoverAlign;
146
- verticalAlign: PopoverVerticalAlign;
147
- maxHeight: number;
148
- measured: boolean;
149
- triggerRef: RefObject<ViewInstance | null>;
150
- }
151
- type ViewInstance = ComponentRef<typeof View>;
152
- declare function useAutoAlign(open: boolean, contentWidth: number, contentHeight: number, rotation?: PopoverRotation, bounds?: RefObject<ViewInstance | null>): AlignResult;
153
-
154
- interface PopoverHost {
155
- openId: string | null;
156
- toggle: (id: string) => void;
157
- close: () => void;
158
- }
159
- declare function usePopoverHost(): PopoverHost;
160
-
161
143
  declare function getInlineColorPickerContentSize(swatchCount: number, windowWidth: number, columns?: number): {
162
144
  width: number;
163
145
  height: number;
@@ -354,4 +336,4 @@ interface WellColors {
354
336
  }
355
337
  declare function useWellColors(): WellColors;
356
338
 
357
- export { AchievementCatalogSection, AchievementRow, ActivityStatSection, type AlignResult, BaseSettingsDialog, type BaseSettingsDialogProps, BaseStatsScreen, COMPACT_DIALOG_HEIGHT, ConfirmDialog, type ConfirmDialogProps, ContentGutter, CornerActionButtons, DialogHeader, type DialogHeaderProps, InlineColorPicker, type InlineColorPickerSwatchPlace, type InlineColorPickerSwatchRenderer, LOCKED_BADGE_COLOR, MONO_FONT, OverlayBackdrop, type OverlayBackdropProps, OverlayCard, type OverlayCardProps, type OverlayCardThemeColors, type PopoverAlign, PopoverBody, type PopoverHost, type PopoverRotation, type PopoverVerticalAlign, PressAwayOverlay, RotatedFrame, type RotatedFrameProps, SecondaryButton, type SecondaryButtonProps, StaggeredWord, type StaggeredWordProps, StatRow, StatSection, UpdateDialog, type UpdateDialogProps, type ViewInstance, WELL_SHADOW, type WellColors, getInlineColorPickerContentSize, getStaggeredWordDuration, isCompactDialogHeight, overlayActionStyles, overlayStyles, useAutoAlign, useCompactDialog, useOverlayCardColors, usePopoverHost, useWellColors };
339
+ export { AchievementCatalogSection, AchievementRow, ActivityStatSection, AlignResult, BaseSettingsDialog, type BaseSettingsDialogProps, BaseStatsScreen, COMPACT_DIALOG_HEIGHT, ConfirmDialog, type ConfirmDialogProps, ContentGutter, CornerActionButtons, DialogHeader, type DialogHeaderProps, InlineColorPicker, type InlineColorPickerSwatchPlace, type InlineColorPickerSwatchRenderer, LOCKED_BADGE_COLOR, MONO_FONT, OverlayBackdrop, type OverlayBackdropProps, OverlayCard, type OverlayCardProps, type OverlayCardThemeColors, PopoverBody, PopoverHost, PopoverRotation, PressAwayOverlay, RotatedFrame, type RotatedFrameProps, SecondaryButton, type SecondaryButtonProps, StaggeredWord, type StaggeredWordProps, StatRow, StatSection, UpdateDialog, type UpdateDialogProps, ViewInstance, WELL_SHADOW, type WellColors, getInlineColorPickerContentSize, getStaggeredWordDuration, isCompactDialogHeight, overlayActionStyles, overlayStyles, useCompactDialog, useOverlayCardColors, useWellColors };
@@ -1,9 +1,11 @@
1
1
  import * as react from 'react';
2
- import { ReactNode, RefObject, ComponentRef } from 'react';
2
+ import { ReactNode, RefObject } from 'react';
3
3
  import { AchievementCatalogRow } from '@tastic/achievements';
4
4
  import { ViewRotation } from '@tastic/core';
5
- import { Insets, StyleProp, ViewStyle, View, LayoutChangeEvent, TextStyle } from 'react-native';
5
+ import { Insets, StyleProp, ViewStyle, LayoutChangeEvent, TextStyle } from 'react-native';
6
6
  import { SeedColor } from '@rific/auto-paper';
7
+ import { P as PopoverHost, A as AlignResult, a as PopoverRotation, V as ViewInstance } from '../usePopoverHost-T8QWb2_A.js';
8
+ export { b as PopoverAlign, c as PopoverVerticalAlign, u as useAutoAlign, d as usePopoverHost } from '../usePopoverHost-T8QWb2_A.js';
7
9
  import { ButtonProps } from '@rific/feedback-press';
8
10
 
9
11
  interface Props$a {
@@ -138,26 +140,6 @@ declare function DialogHeader({ icon, title, color, compact, style }: DialogHead
138
140
 
139
141
  declare const MONO_FONT: string;
140
142
 
141
- type PopoverAlign = 'left' | 'right' | 'center';
142
- type PopoverVerticalAlign = 'below' | 'above';
143
- type PopoverRotation = ViewRotation;
144
- interface AlignResult {
145
- align: PopoverAlign;
146
- verticalAlign: PopoverVerticalAlign;
147
- maxHeight: number;
148
- measured: boolean;
149
- triggerRef: RefObject<ViewInstance | null>;
150
- }
151
- type ViewInstance = ComponentRef<typeof View>;
152
- declare function useAutoAlign(open: boolean, contentWidth: number, contentHeight: number, rotation?: PopoverRotation, bounds?: RefObject<ViewInstance | null>): AlignResult;
153
-
154
- interface PopoverHost {
155
- openId: string | null;
156
- toggle: (id: string) => void;
157
- close: () => void;
158
- }
159
- declare function usePopoverHost(): PopoverHost;
160
-
161
143
  declare function getInlineColorPickerContentSize(swatchCount: number, windowWidth: number, columns?: number): {
162
144
  width: number;
163
145
  height: number;
@@ -354,4 +336,4 @@ interface WellColors {
354
336
  }
355
337
  declare function useWellColors(): WellColors;
356
338
 
357
- export { AchievementCatalogSection, AchievementRow, ActivityStatSection, type AlignResult, BaseSettingsDialog, type BaseSettingsDialogProps, BaseStatsScreen, COMPACT_DIALOG_HEIGHT, ConfirmDialog, type ConfirmDialogProps, ContentGutter, CornerActionButtons, DialogHeader, type DialogHeaderProps, InlineColorPicker, type InlineColorPickerSwatchPlace, type InlineColorPickerSwatchRenderer, LOCKED_BADGE_COLOR, MONO_FONT, OverlayBackdrop, type OverlayBackdropProps, OverlayCard, type OverlayCardProps, type OverlayCardThemeColors, type PopoverAlign, PopoverBody, type PopoverHost, type PopoverRotation, type PopoverVerticalAlign, PressAwayOverlay, RotatedFrame, type RotatedFrameProps, SecondaryButton, type SecondaryButtonProps, StaggeredWord, type StaggeredWordProps, StatRow, StatSection, UpdateDialog, type UpdateDialogProps, type ViewInstance, WELL_SHADOW, type WellColors, getInlineColorPickerContentSize, getStaggeredWordDuration, isCompactDialogHeight, overlayActionStyles, overlayStyles, useAutoAlign, useCompactDialog, useOverlayCardColors, usePopoverHost, useWellColors };
339
+ export { AchievementCatalogSection, AchievementRow, ActivityStatSection, AlignResult, BaseSettingsDialog, type BaseSettingsDialogProps, BaseStatsScreen, COMPACT_DIALOG_HEIGHT, ConfirmDialog, type ConfirmDialogProps, ContentGutter, CornerActionButtons, DialogHeader, type DialogHeaderProps, InlineColorPicker, type InlineColorPickerSwatchPlace, type InlineColorPickerSwatchRenderer, LOCKED_BADGE_COLOR, MONO_FONT, OverlayBackdrop, type OverlayBackdropProps, OverlayCard, type OverlayCardProps, type OverlayCardThemeColors, PopoverBody, PopoverHost, PopoverRotation, PressAwayOverlay, RotatedFrame, type RotatedFrameProps, SecondaryButton, type SecondaryButtonProps, StaggeredWord, type StaggeredWordProps, StatRow, StatSection, UpdateDialog, type UpdateDialogProps, ViewInstance, WELL_SHADOW, type WellColors, getInlineColorPickerContentSize, getStaggeredWordDuration, isCompactDialogHeight, overlayActionStyles, overlayStyles, useCompactDialog, useOverlayCardColors, useWellColors };
@@ -7,10 +7,7 @@ import {
7
7
  ConfirmDialog,
8
8
  ContentGutter,
9
9
  CornerActionButtons,
10
- InlineColorPicker,
11
10
  LOCKED_BADGE_COLOR,
12
- MONO_FONT,
13
- PopoverBody,
14
11
  PressAwayOverlay,
15
12
  RotatedFrame,
16
13
  StaggeredWord,
@@ -18,13 +15,10 @@ import {
18
15
  StatSection,
19
16
  UpdateDialog,
20
17
  WELL_SHADOW,
21
- getInlineColorPickerContentSize,
22
18
  getStaggeredWordDuration,
23
- useAutoAlign,
24
19
  useCompactDialog,
25
- usePopoverHost,
26
20
  useWellColors
27
- } from "../chunk-AJD4FMG5.mjs";
21
+ } from "../chunk-33MWHPPH.mjs";
28
22
  import {
29
23
  COMPACT_DIALOG_HEIGHT,
30
24
  DialogHeader,
@@ -36,6 +30,14 @@ import {
36
30
  overlayStyles,
37
31
  useOverlayCardColors
38
32
  } from "../chunk-CBH7GQKI.mjs";
33
+ import {
34
+ InlineColorPicker,
35
+ MONO_FONT,
36
+ PopoverBody,
37
+ getInlineColorPickerContentSize,
38
+ useAutoAlign,
39
+ usePopoverHost
40
+ } from "../chunk-FOJLQMKA.mjs";
39
41
  export {
40
42
  AchievementCatalogSection,
41
43
  AchievementRow,