@tastic/hud 0.12.0 → 0.14.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 +169 -11
- package/dist/chunk-32U2OIRW.mjs +77 -0
- package/dist/guide/index.d.mts +118 -0
- package/dist/guide/index.d.ts +118 -0
- package/dist/guide/index.js +543 -0
- package/dist/guide/index.mjs +428 -0
- package/dist/index.d.mts +80 -9
- package/dist/index.d.ts +80 -9
- package/dist/index.js +417 -317
- package/dist/index.mjs +324 -296
- package/package.json +34 -7
- package/src/AchievementUnlockList.tsx +98 -0
- package/src/BaseSettingsDialog.tsx +179 -135
- package/src/ConfirmDialog.tsx +4 -43
- package/src/ContentGutter.tsx +12 -5
- package/src/RotatedFrame.tsx +71 -0
- package/src/guide/DirectionKeysHint.tsx +96 -0
- package/src/guide/GuideProvider.tsx +87 -0
- package/src/guide/HowToPlayDialog.tsx +224 -0
- package/src/guide/SeatDevicesHint.tsx +52 -0
- package/src/guide/SeatDiagram.tsx +72 -0
- package/src/guide/SwipeHint.tsx +115 -0
- package/src/guide/guideSlice.ts +131 -0
- package/src/guide/index.ts +14 -0
- package/src/guide/types.ts +16 -0
- package/src/index.ts +3 -1
- package/src/overlayCard.ts +51 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, RefObject } from 'react';
|
|
3
|
-
import { AchievementCatalogRow } from '@tastic/achievements';
|
|
3
|
+
import { AchievementCatalogRow, AchievementTier } from '@tastic/achievements';
|
|
4
|
+
import { Profile } from '@tastic/profile';
|
|
5
|
+
import { ViewStyle, StyleProp, View, TextStyle, LayoutChangeEvent } from 'react-native';
|
|
4
6
|
import { ViewRotation } from '@tastic/core';
|
|
5
|
-
import { StyleProp, ViewStyle, View, TextStyle, LayoutChangeEvent } from 'react-native';
|
|
6
7
|
import { SeedColor } from '@rific/auto-paper';
|
|
7
|
-
import { Profile } from '@tastic/profile';
|
|
8
8
|
export { SkiaGate, SkiaGateProps } from './SkiaGate.js';
|
|
9
9
|
|
|
10
|
-
interface Props$
|
|
10
|
+
interface Props$f {
|
|
11
11
|
rows: AchievementCatalogRow[];
|
|
12
12
|
label?: string;
|
|
13
13
|
fg?: string;
|
|
14
14
|
fgMuted?: string;
|
|
15
15
|
}
|
|
16
|
-
declare function AchievementCatalogSection({ rows, label, fg, fgMuted: fgMutedOverride }: Props$
|
|
16
|
+
declare function AchievementCatalogSection({ rows, label, fg, fgMuted: fgMutedOverride }: Props$f): react.JSX.Element;
|
|
17
17
|
|
|
18
18
|
declare const LOCKED_BADGE_COLOR = "rgba(128,128,128,0.3)";
|
|
19
|
-
interface Props$
|
|
19
|
+
interface Props$e {
|
|
20
20
|
icon: string;
|
|
21
21
|
title: string;
|
|
22
22
|
description: string;
|
|
@@ -29,7 +29,27 @@ interface Props$d {
|
|
|
29
29
|
fgMuted?: string;
|
|
30
30
|
sectionBg?: string;
|
|
31
31
|
}
|
|
32
|
-
declare function AchievementRow({ icon, title, description, badgeColor, unlockedLabel, checkColor, progress, deviceMarker, fg: fgOverride, fgMuted: fgMutedOverride, sectionBg: sectionBgOverride }: Props$
|
|
32
|
+
declare function AchievementRow({ icon, title, description, badgeColor, unlockedLabel, checkColor, progress, deviceMarker, fg: fgOverride, fgMuted: fgMutedOverride, sectionBg: sectionBgOverride }: Props$e): react.JSX.Element;
|
|
33
|
+
|
|
34
|
+
interface UnlockedAchievement {
|
|
35
|
+
id: string;
|
|
36
|
+
icon: string;
|
|
37
|
+
title: string;
|
|
38
|
+
tier: AchievementTier;
|
|
39
|
+
}
|
|
40
|
+
interface AchievementUnlockOwner {
|
|
41
|
+
profile?: Profile | null;
|
|
42
|
+
color: string;
|
|
43
|
+
}
|
|
44
|
+
interface Props$d<Seat extends number> {
|
|
45
|
+
unlocks: Partial<Record<Seat, UnlockedAchievement[]>>;
|
|
46
|
+
seats: readonly Seat[];
|
|
47
|
+
owners: Record<Seat, AchievementUnlockOwner>;
|
|
48
|
+
tierColors: Record<AchievementTier, string>;
|
|
49
|
+
fg?: string;
|
|
50
|
+
style?: ViewStyle;
|
|
51
|
+
}
|
|
52
|
+
declare function AchievementUnlockList<Seat extends number>({ unlocks, seats, owners, tierColors, fg: fgOverride, style }: Props$d<Seat>): react.JSX.Element | null;
|
|
33
53
|
|
|
34
54
|
interface ActivityStats {
|
|
35
55
|
distinctDaysPlayed: number;
|
|
@@ -55,9 +75,10 @@ interface BaseSettingsDialogProps {
|
|
|
55
75
|
hideAppearance?: boolean;
|
|
56
76
|
hideUpdateCheck?: boolean;
|
|
57
77
|
onUpdateError?: (message: string) => void;
|
|
78
|
+
onShowHowToPlay?: () => void;
|
|
58
79
|
children?: ReactNode;
|
|
59
80
|
}
|
|
60
|
-
declare function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, version, lockOrientation, onLockOrientationChange, deferBottomEdgeGestures, onDeferBottomEdgeGestures, hideSound, hideHaptics, hideAppearance, hideUpdateCheck, onUpdateError, children }: BaseSettingsDialogProps): react.JSX.Element;
|
|
81
|
+
declare function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, version, lockOrientation, onLockOrientationChange, deferBottomEdgeGestures, onDeferBottomEdgeGestures, hideSound, hideHaptics, hideAppearance, hideUpdateCheck, onUpdateError, onShowHowToPlay, children }: BaseSettingsDialogProps): react.JSX.Element;
|
|
61
82
|
|
|
62
83
|
type MD3TextVariant = 'displayLarge' | 'displayMedium' | 'displaySmall' | 'headlineLarge' | 'headlineMedium' | 'headlineSmall' | 'titleLarge' | 'titleMedium' | 'titleSmall' | 'labelLarge' | 'labelMedium' | 'labelSmall' | 'bodyLarge' | 'bodyMedium' | 'bodySmall';
|
|
63
84
|
interface Props$b {
|
|
@@ -296,6 +317,22 @@ declare const overlayStyles: {
|
|
|
296
317
|
top: number;
|
|
297
318
|
};
|
|
298
319
|
};
|
|
320
|
+
declare const overlayActionStyles: {
|
|
321
|
+
actionButton: {
|
|
322
|
+
flexGrow: number;
|
|
323
|
+
minWidth: number;
|
|
324
|
+
};
|
|
325
|
+
actionButtonSingle: {
|
|
326
|
+
minWidth: number;
|
|
327
|
+
};
|
|
328
|
+
actions: {
|
|
329
|
+
flexDirection: "row";
|
|
330
|
+
flexWrap: "wrap";
|
|
331
|
+
gap: number;
|
|
332
|
+
justifyContent: "center";
|
|
333
|
+
width: "100%";
|
|
334
|
+
};
|
|
335
|
+
};
|
|
299
336
|
|
|
300
337
|
declare function getColorPopoverId(idPrefix: string): string;
|
|
301
338
|
declare function getCpuDifficultyPopoverId(idPrefix: string): string;
|
|
@@ -361,6 +398,40 @@ interface Props$3 {
|
|
|
361
398
|
}
|
|
362
399
|
declare function ReadyButton({ color, ready, onToggleReady, style, labelFontFamily }: Props$3): react.JSX.Element;
|
|
363
400
|
|
|
401
|
+
interface RotatedFrameProps {
|
|
402
|
+
children: ReactNode;
|
|
403
|
+
/** The angle to turn the frame by. Defaults to the live physical hold (@tastic/core's useRotation); pass it
|
|
404
|
+
* when the caller already has the exact angle it wants, e.g. a dialog handed its caller's rotation, or 0 for
|
|
405
|
+
* one that already sits inside a turned frame. */
|
|
406
|
+
rotation?: ViewRotation;
|
|
407
|
+
/** Give everything inside the frame the safe-area insets already remapped onto the frame's own edges (see
|
|
408
|
+
* @tastic/core's rotateInsets), so a component that reads `useSafeAreaInsets()` itself (a library screen,
|
|
409
|
+
* Paper's Modal, a toaster) lands on the right edge when the frame is turned. Leave it off for content that
|
|
410
|
+
* rotates the insets itself, which would otherwise rotate them twice. */
|
|
411
|
+
rotatedSafeArea?: boolean;
|
|
412
|
+
/** Mount a Paper Portal.Host INSIDE the frame, so a dialog (Paper's Portal otherwise mounts at the app root,
|
|
413
|
+
* outside the frame) is laid out against the frame's footprint and turned with it. The dialog must then be
|
|
414
|
+
* told `rotation={0}`. */
|
|
415
|
+
portalHost?: boolean;
|
|
416
|
+
/** Let touches fall through the frame to whatever is beneath it, so only its children claim them. For a frame
|
|
417
|
+
* laid OVER other content (a dialog layer, a root-level overlay); a screen that owns the window leaves it off. */
|
|
418
|
+
passThrough?: boolean;
|
|
419
|
+
/** Cap on the content column's width in the WIDE layout only (the rotated footprint is landscape), centred: a
|
|
420
|
+
* stats list or a roster stretched across an 874pt-wide landscape screen reads badly. Portrait is never capped,
|
|
421
|
+
* so a portrait iPad or desktop window keeps its full width. Omit for no cap. */
|
|
422
|
+
maxContentWidth?: number;
|
|
423
|
+
}
|
|
424
|
+
/** A frame turned to follow the phone while the OS stays portrait-locked (see @tastic/core's FakeLandscapeView),
|
|
425
|
+
* sized to the turned footprint so its content lays out against the short edge at +/-90. The tree is IDENTICAL
|
|
426
|
+
* at every angle, so a rotation never remounts what is inside: `FakeLandscapeView > SafeArea provider >
|
|
427
|
+
* [Portal.Host] > column`. `rotation`, `rotatedSafeArea`, `passThrough` and `maxContentWidth` only change styles
|
|
428
|
+
* and values, but `portalHost` adds or removes the Portal.Host element, so it must be STATIC per call site
|
|
429
|
+
* (flipping it at runtime would remount everything inside).
|
|
430
|
+
*
|
|
431
|
+
* Safe for tap-driven content only: react-native-gesture-handler's translation deltas are untransformed, so
|
|
432
|
+
* never put a gesture-tracked game board inside it. */
|
|
433
|
+
declare function RotatedFrame({ children, rotation: rotationOverride, rotatedSafeArea, portalHost, passThrough, maxContentWidth }: RotatedFrameProps): react.JSX.Element;
|
|
434
|
+
|
|
364
435
|
interface Props$2 {
|
|
365
436
|
onBack: () => void;
|
|
366
437
|
onSettings: () => void;
|
|
@@ -437,4 +508,4 @@ declare function useQuitConfirmation(hasProgress: () => boolean, onConfirmedBack
|
|
|
437
508
|
|
|
438
509
|
declare function useZoneClampedAlign(open: boolean, contentWidth: number, contentHeight: number, rotation?: PopoverRotation): ReturnType<typeof useAutoAlign>;
|
|
439
510
|
|
|
440
|
-
export { AchievementCatalogSection, AchievementRow, ActivityStatSection, type AlignResult, BaseSettingsDialog, type BaseSettingsDialogProps, BaseStatsScreen, ConfirmDialog, type ConfirmDialogProps, ContentGutter, ControlSchemePicker, type ControlSchemePickerProps, CornerActionButtons, type CornerStatusBadgeSeat, CornerStatusBadges, type CornerStatusBadgesProps, InlineColorPicker, LABELED_DROPDOWN_POPOVER_WIDTH, LOCKED_BADGE_COLOR, LabeledDropdown, type LabeledDropdownOption, MONO_FONT, type MenuOption, type MenuSection, type MultiSelectSection, type OrientationMode, type OverlayCardColors, PlayerSetupPanel, type PlayerSetupPanelProps, type PopoverAlign, PopoverBody, type PopoverHost, type PopoverRotation, type PopoverVerticalAlign, PressAwayOverlay, type QuitConfirmation, ReadyButton, SectionedDropdown, SharedActionBand, type SingleSelectSection, StaggeredWord, type StaggeredWordProps, StatRow, StatSection, TriggerGaugeHost, type TriggerGaugeProps, UpdateDialog, type UpdateDialogProps, getColorPopoverId, getCpuDifficultyPopoverId, getInlineColorPickerContentSize, getLabeledDropdownContentHeight, getOverlayCardColors, getStaggeredWordDuration, loadSkiaWeb, overlayStyles, useAutoAlign, usePopoverHost, useQuitConfirmation, useZoneClampedAlign };
|
|
511
|
+
export { AchievementCatalogSection, AchievementRow, AchievementUnlockList, type AchievementUnlockOwner, ActivityStatSection, type AlignResult, BaseSettingsDialog, type BaseSettingsDialogProps, BaseStatsScreen, ConfirmDialog, type ConfirmDialogProps, ContentGutter, ControlSchemePicker, type ControlSchemePickerProps, CornerActionButtons, type CornerStatusBadgeSeat, CornerStatusBadges, type CornerStatusBadgesProps, InlineColorPicker, LABELED_DROPDOWN_POPOVER_WIDTH, LOCKED_BADGE_COLOR, LabeledDropdown, type LabeledDropdownOption, MONO_FONT, type MenuOption, type MenuSection, type MultiSelectSection, type OrientationMode, type OverlayCardColors, PlayerSetupPanel, type PlayerSetupPanelProps, type PopoverAlign, PopoverBody, type PopoverHost, type PopoverRotation, type PopoverVerticalAlign, PressAwayOverlay, type QuitConfirmation, ReadyButton, RotatedFrame, type RotatedFrameProps, SectionedDropdown, SharedActionBand, type SingleSelectSection, StaggeredWord, type StaggeredWordProps, StatRow, StatSection, TriggerGaugeHost, type TriggerGaugeProps, type UnlockedAchievement, UpdateDialog, type UpdateDialogProps, getColorPopoverId, getCpuDifficultyPopoverId, getInlineColorPickerContentSize, getLabeledDropdownContentHeight, getOverlayCardColors, getStaggeredWordDuration, loadSkiaWeb, overlayActionStyles, overlayStyles, useAutoAlign, usePopoverHost, useQuitConfirmation, useZoneClampedAlign };
|