@tastic/hud 0.25.1 → 0.27.1
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 +47 -11
- package/dist/chrome/index.d.mts +5 -23
- package/dist/chrome/index.d.ts +5 -23
- package/dist/chrome/index.mjs +9 -7
- package/dist/chunk-B2DSHZJT.mjs +177 -0
- package/dist/chunk-FOJLQMKA.mjs +315 -0
- package/dist/{chunk-AJD4FMG5.mjs → chunk-JBE7IQC5.mjs} +26 -336
- package/dist/index-1fnoSjO0.d.ts +100 -0
- package/dist/index-Bhu3I6FN.d.mts +100 -0
- package/dist/index.d.mts +12 -97
- package/dist/index.d.ts +12 -97
- package/dist/index.js +8 -6
- package/dist/index.mjs +26 -176
- package/dist/lobby/index.d.mts +7 -0
- package/dist/lobby/index.d.ts +7 -0
- package/dist/lobby/index.js +513 -0
- package/dist/lobby/index.mjs +19 -0
- package/dist/usePopoverHost-T8QWb2_A.d.mts +25 -0
- package/dist/usePopoverHost-T8QWb2_A.d.ts +25 -0
- package/package.json +11 -4
- package/src/PlayerSetupPanel.tsx +34 -12
- package/src/SectionedDropdown.tsx +4 -11
- package/src/lobby/index.ts +13 -0
- package/src/menuOption.ts +14 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
export { AchievementCatalogSection, AchievementRow, ActivityStatSection, BaseSettingsDialog, BaseSettingsDialogProps, BaseStatsScreen, COMPACT_DIALOG_HEIGHT, ConfirmDialog, ConfirmDialogProps, ContentGutter, CornerActionButtons, DialogHeader, DialogHeaderProps, InlineColorPicker, InlineColorPickerSwatchPlace, InlineColorPickerSwatchRenderer, LOCKED_BADGE_COLOR, MONO_FONT, OverlayBackdrop, OverlayBackdropProps, OverlayCard, OverlayCardProps, OverlayCardThemeColors, PopoverAlign, PopoverBody, PopoverVerticalAlign, PressAwayOverlay, RotatedFrame, RotatedFrameProps, SecondaryButton, SecondaryButtonProps, StaggeredWord, StaggeredWordProps, StatRow, StatSection, UpdateDialog, UpdateDialogProps, ViewInstance, WELL_SHADOW, WellColors, getInlineColorPickerContentSize, getStaggeredWordDuration, isCompactDialogHeight, overlayActionStyles, overlayStyles, useCompactDialog, useOverlayCardColors, usePopoverHost, useWellColors } from './chrome/index.mjs';
|
|
1
|
+
export { AchievementCatalogSection, AchievementRow, ActivityStatSection, BaseSettingsDialog, BaseSettingsDialogProps, BaseStatsScreen, COMPACT_DIALOG_HEIGHT, ConfirmDialog, ConfirmDialogProps, ContentGutter, CornerActionButtons, DialogHeader, DialogHeaderProps, InlineColorPicker, InlineColorPickerSwatchPlace, InlineColorPickerSwatchRenderer, LOCKED_BADGE_COLOR, MONO_FONT, OverlayBackdrop, OverlayBackdropProps, OverlayCard, OverlayCardProps, OverlayCardThemeColors, PopoverBody, PressAwayOverlay, RotatedFrame, RotatedFrameProps, SecondaryButton, SecondaryButtonProps, StaggeredWord, StaggeredWordProps, StatRow, StatSection, UpdateDialog, UpdateDialogProps, WELL_SHADOW, WellColors, getInlineColorPickerContentSize, getStaggeredWordDuration, isCompactDialogHeight, overlayActionStyles, overlayStyles, useCompactDialog, useOverlayCardColors, useWellColors } from './chrome/index.mjs';
|
|
3
2
|
import * as react from 'react';
|
|
4
|
-
import { ReactNode } from 'react';
|
|
5
3
|
import { AchievementTier } from '@tastic/achievements';
|
|
6
4
|
import { Profile } from '@tastic/profile';
|
|
7
|
-
import { ViewStyle
|
|
5
|
+
import { ViewStyle } from 'react-native';
|
|
6
|
+
import { M as MenuOption } from './index-Bhu3I6FN.mjs';
|
|
7
|
+
export { L as LABELED_DROPDOWN_POPOVER_WIDTH, a as LabeledDropdown, b as LabeledDropdownOption, P as PlayerSetupPanel, c as PlayerSetupPanelProps, R as ReadyButton, S as SharedActionBand, g as getColorPopoverId, d as getCpuDifficultyPopoverId, e as getLabeledDropdownContentHeight, f as getProfilePopoverId, u as useZoneClampedAlign } from './index-Bhu3I6FN.mjs';
|
|
8
|
+
import { P as PopoverHost, A as AlignResult, a as PopoverRotation } from './usePopoverHost-T8QWb2_A.mjs';
|
|
9
|
+
export { b as PopoverAlign, c as PopoverVerticalAlign, V as ViewInstance, u as useAutoAlign, d as usePopoverHost } from './usePopoverHost-T8QWb2_A.mjs';
|
|
8
10
|
export { loadSkiaWeb, locateSkiaWebFile } from './skia/index.mjs';
|
|
9
|
-
import { SeedColor } from '@rific/auto-paper';
|
|
10
11
|
import '@tastic/core';
|
|
12
|
+
import '@rific/auto-paper';
|
|
11
13
|
import '@rific/feedback-press';
|
|
12
14
|
|
|
13
15
|
interface UnlockedAchievement {
|
|
@@ -20,7 +22,7 @@ interface AchievementUnlockOwner {
|
|
|
20
22
|
profile?: Profile | null;
|
|
21
23
|
color: string;
|
|
22
24
|
}
|
|
23
|
-
interface Props$
|
|
25
|
+
interface Props$1<Seat extends number> {
|
|
24
26
|
unlocks: Partial<Record<Seat, UnlockedAchievement[]>>;
|
|
25
27
|
seats: readonly Seat[];
|
|
26
28
|
owners: Record<Seat, AchievementUnlockOwner>;
|
|
@@ -28,15 +30,8 @@ interface Props$4<Seat extends number> {
|
|
|
28
30
|
fg?: string;
|
|
29
31
|
style?: ViewStyle;
|
|
30
32
|
}
|
|
31
|
-
declare function AchievementUnlockList<Seat extends number>({ unlocks, seats, owners, tierColors, fg: fgOverride, style }: Props$
|
|
33
|
+
declare function AchievementUnlockList<Seat extends number>({ unlocks, seats, owners, tierColors, fg: fgOverride, style }: Props$1<Seat>): react.JSX.Element | null;
|
|
32
34
|
|
|
33
|
-
interface MenuOption<T extends string | number> {
|
|
34
|
-
value: T;
|
|
35
|
-
label: string;
|
|
36
|
-
description?: string;
|
|
37
|
-
icon?: string;
|
|
38
|
-
iconSize?: number;
|
|
39
|
-
}
|
|
40
35
|
interface SingleSelectSection<T extends string | number> {
|
|
41
36
|
kind: 'single';
|
|
42
37
|
id: string;
|
|
@@ -54,7 +49,7 @@ interface MultiSelectSection<T extends string | number> {
|
|
|
54
49
|
allClear?: boolean;
|
|
55
50
|
}
|
|
56
51
|
type MenuSection = SingleSelectSection<any> | MultiSelectSection<any>;
|
|
57
|
-
interface Props
|
|
52
|
+
interface Props {
|
|
58
53
|
id: string;
|
|
59
54
|
host: PopoverHost;
|
|
60
55
|
icon: string;
|
|
@@ -74,7 +69,7 @@ interface Props$3 {
|
|
|
74
69
|
clear: string;
|
|
75
70
|
};
|
|
76
71
|
}
|
|
77
|
-
declare function SectionedDropdown({ id, host, icon, accessibilityLabel, sections, accentColor, mutedColor, onAccentColor, dark, align: forcedAlign, alignOverride, rotation: rotationOverride, autoDismiss, labelFontFamily, allClearLabels }: Props
|
|
72
|
+
declare function SectionedDropdown({ id, host, icon, accessibilityLabel, sections, accentColor, mutedColor, onAccentColor, dark, align: forcedAlign, alignOverride, rotation: rotationOverride, autoDismiss, labelFontFamily, allClearLabels }: Props): react.JSX.Element;
|
|
78
73
|
|
|
79
74
|
interface ControlSchemePickerProps<T extends string | number> {
|
|
80
75
|
id: string;
|
|
@@ -106,84 +101,6 @@ interface CornerStatusBadgesProps {
|
|
|
106
101
|
}
|
|
107
102
|
declare function CornerStatusBadges({ orientationMode, p1OnRight, p1, p2 }: CornerStatusBadgesProps): react.JSX.Element;
|
|
108
103
|
|
|
109
|
-
declare const LABELED_DROPDOWN_POPOVER_WIDTH = 180;
|
|
110
|
-
declare function getLabeledDropdownContentHeight(optionCount: number): number;
|
|
111
|
-
interface LabeledDropdownOption<T extends string> {
|
|
112
|
-
value: T;
|
|
113
|
-
label: string;
|
|
114
|
-
icon?: string;
|
|
115
|
-
}
|
|
116
|
-
interface Props$2<T extends string> {
|
|
117
|
-
id: string;
|
|
118
|
-
host: PopoverHost;
|
|
119
|
-
options: LabeledDropdownOption<T>[];
|
|
120
|
-
value: T;
|
|
121
|
-
onChange: (value: T) => void;
|
|
122
|
-
color: string;
|
|
123
|
-
dark: boolean;
|
|
124
|
-
align?: 'left' | 'right' | 'center';
|
|
125
|
-
alignOverride?: AlignResult;
|
|
126
|
-
}
|
|
127
|
-
declare function LabeledDropdown<T extends string>({ id, host, options, value, onChange, color, dark, align: forcedAlign, alignOverride }: Props$2<T>): react.JSX.Element;
|
|
128
|
-
|
|
129
|
-
declare function getColorPopoverId(idPrefix: string): string;
|
|
130
|
-
declare function getProfilePopoverId(idPrefix: string): string;
|
|
131
|
-
declare function getCpuDifficultyPopoverId(idPrefix: string): string;
|
|
132
|
-
interface PlayerSetupPanelProps<C extends string = string> {
|
|
133
|
-
idPrefix: string;
|
|
134
|
-
host?: PopoverHost;
|
|
135
|
-
label?: string;
|
|
136
|
-
labelFontFamily?: string;
|
|
137
|
-
color: string;
|
|
138
|
-
onColorChange: (hex: string) => void;
|
|
139
|
-
swatches: SeedColor[];
|
|
140
|
-
takenColor?: string;
|
|
141
|
-
allowSwapTaken?: boolean;
|
|
142
|
-
colorCaption?: string;
|
|
143
|
-
showColor?: boolean;
|
|
144
|
-
colorAlignOverride?: AlignResult;
|
|
145
|
-
colorRotation?: PopoverRotation;
|
|
146
|
-
isHuman: boolean;
|
|
147
|
-
secondPicker?: ReactNode;
|
|
148
|
-
secondPickerId?: string;
|
|
149
|
-
ready?: boolean;
|
|
150
|
-
onToggleReady?: () => void;
|
|
151
|
-
dark: boolean;
|
|
152
|
-
showReadyButton?: boolean;
|
|
153
|
-
profiles?: Profile[];
|
|
154
|
-
selectedProfileId?: string | null;
|
|
155
|
-
takenProfileId?: string | null;
|
|
156
|
-
guestLabel?: string;
|
|
157
|
-
onProfileSelect?: (profile: Profile | null) => void;
|
|
158
|
-
onManageProfiles?: () => void;
|
|
159
|
-
cpuDifficulty?: C;
|
|
160
|
-
cpuDifficultyOptions?: LabeledDropdownOption<C>[];
|
|
161
|
-
onCpuDifficultyChange?: (value: C) => void;
|
|
162
|
-
humanIcon?: string;
|
|
163
|
-
cpuIcon?: string;
|
|
164
|
-
}
|
|
165
|
-
declare function PlayerSetupPanel<C extends string = string>({ idPrefix, host, label, labelFontFamily, color, onColorChange, swatches, takenColor, allowSwapTaken, colorCaption, showColor, colorAlignOverride, colorRotation, isHuman, secondPicker, secondPickerId, ready, onToggleReady, dark, showReadyButton, profiles, selectedProfileId, takenProfileId, guestLabel, onProfileSelect, onManageProfiles, cpuDifficulty, cpuDifficultyOptions, onCpuDifficultyChange, humanIcon, cpuIcon }: PlayerSetupPanelProps<C>): react.JSX.Element;
|
|
166
|
-
|
|
167
|
-
interface Props$1 {
|
|
168
|
-
color: string;
|
|
169
|
-
ready: boolean;
|
|
170
|
-
onToggleReady: () => void;
|
|
171
|
-
style?: StyleProp<ViewStyle>;
|
|
172
|
-
labelFontFamily?: string;
|
|
173
|
-
}
|
|
174
|
-
declare function ReadyButton({ color, ready, onToggleReady, style, labelFontFamily }: Props$1): react.JSX.Element;
|
|
175
|
-
|
|
176
|
-
interface Props {
|
|
177
|
-
onBack: () => void;
|
|
178
|
-
onSettings: () => void;
|
|
179
|
-
onRandomize?: () => void;
|
|
180
|
-
onReset?: () => void;
|
|
181
|
-
fg: string;
|
|
182
|
-
popoverOpen: boolean;
|
|
183
|
-
children: ReactNode;
|
|
184
|
-
}
|
|
185
|
-
declare function SharedActionBand({ onBack, onSettings, onRandomize, onReset, fg, popoverOpen, children }: Props): react.JSX.Element;
|
|
186
|
-
|
|
187
104
|
interface TriggerGaugeProps {
|
|
188
105
|
segments: number;
|
|
189
106
|
litIndices: number[];
|
|
@@ -207,6 +124,4 @@ interface QuitConfirmation {
|
|
|
207
124
|
}
|
|
208
125
|
declare function useQuitConfirmation(hasProgress: () => boolean, onConfirmedBack: () => void): QuitConfirmation;
|
|
209
126
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
export { AchievementUnlockList, type AchievementUnlockOwner, AlignResult, ControlSchemePicker, type ControlSchemePickerProps, type CornerStatusBadgeSeat, CornerStatusBadges, type CornerStatusBadgesProps, LABELED_DROPDOWN_POPOVER_WIDTH, LabeledDropdown, type LabeledDropdownOption, type MenuOption, type MenuSection, type MultiSelectSection, type OrientationMode, PlayerSetupPanel, type PlayerSetupPanelProps, PopoverHost, PopoverRotation, type QuitConfirmation, ReadyButton, SectionedDropdown, SharedActionBand, type SingleSelectSection, TriggerGaugeHost, type TriggerGaugeProps, type UnlockedAchievement, getColorPopoverId, getCpuDifficultyPopoverId, getLabeledDropdownContentHeight, getProfilePopoverId, useAutoAlign, useQuitConfirmation, useZoneClampedAlign };
|
|
127
|
+
export { AchievementUnlockList, type AchievementUnlockOwner, AlignResult, ControlSchemePicker, type ControlSchemePickerProps, type CornerStatusBadgeSeat, CornerStatusBadges, type CornerStatusBadgesProps, MenuOption, type MenuSection, type MultiSelectSection, type OrientationMode, PopoverHost, PopoverRotation, type QuitConfirmation, SectionedDropdown, type SingleSelectSection, TriggerGaugeHost, type TriggerGaugeProps, type UnlockedAchievement, useQuitConfirmation };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
export { AchievementCatalogSection, AchievementRow, ActivityStatSection, BaseSettingsDialog, BaseSettingsDialogProps, BaseStatsScreen, COMPACT_DIALOG_HEIGHT, ConfirmDialog, ConfirmDialogProps, ContentGutter, CornerActionButtons, DialogHeader, DialogHeaderProps, InlineColorPicker, InlineColorPickerSwatchPlace, InlineColorPickerSwatchRenderer, LOCKED_BADGE_COLOR, MONO_FONT, OverlayBackdrop, OverlayBackdropProps, OverlayCard, OverlayCardProps, OverlayCardThemeColors, PopoverAlign, PopoverBody, PopoverVerticalAlign, PressAwayOverlay, RotatedFrame, RotatedFrameProps, SecondaryButton, SecondaryButtonProps, StaggeredWord, StaggeredWordProps, StatRow, StatSection, UpdateDialog, UpdateDialogProps, ViewInstance, WELL_SHADOW, WellColors, getInlineColorPickerContentSize, getStaggeredWordDuration, isCompactDialogHeight, overlayActionStyles, overlayStyles, useCompactDialog, useOverlayCardColors, usePopoverHost, useWellColors } from './chrome/index.js';
|
|
1
|
+
export { AchievementCatalogSection, AchievementRow, ActivityStatSection, BaseSettingsDialog, BaseSettingsDialogProps, BaseStatsScreen, COMPACT_DIALOG_HEIGHT, ConfirmDialog, ConfirmDialogProps, ContentGutter, CornerActionButtons, DialogHeader, DialogHeaderProps, InlineColorPicker, InlineColorPickerSwatchPlace, InlineColorPickerSwatchRenderer, LOCKED_BADGE_COLOR, MONO_FONT, OverlayBackdrop, OverlayBackdropProps, OverlayCard, OverlayCardProps, OverlayCardThemeColors, PopoverBody, PressAwayOverlay, RotatedFrame, RotatedFrameProps, SecondaryButton, SecondaryButtonProps, StaggeredWord, StaggeredWordProps, StatRow, StatSection, UpdateDialog, UpdateDialogProps, WELL_SHADOW, WellColors, getInlineColorPickerContentSize, getStaggeredWordDuration, isCompactDialogHeight, overlayActionStyles, overlayStyles, useCompactDialog, useOverlayCardColors, useWellColors } from './chrome/index.js';
|
|
3
2
|
import * as react from 'react';
|
|
4
|
-
import { ReactNode } from 'react';
|
|
5
3
|
import { AchievementTier } from '@tastic/achievements';
|
|
6
4
|
import { Profile } from '@tastic/profile';
|
|
7
|
-
import { ViewStyle
|
|
5
|
+
import { ViewStyle } from 'react-native';
|
|
6
|
+
import { M as MenuOption } from './index-1fnoSjO0.js';
|
|
7
|
+
export { L as LABELED_DROPDOWN_POPOVER_WIDTH, a as LabeledDropdown, b as LabeledDropdownOption, P as PlayerSetupPanel, c as PlayerSetupPanelProps, R as ReadyButton, S as SharedActionBand, g as getColorPopoverId, d as getCpuDifficultyPopoverId, e as getLabeledDropdownContentHeight, f as getProfilePopoverId, u as useZoneClampedAlign } from './index-1fnoSjO0.js';
|
|
8
|
+
import { P as PopoverHost, A as AlignResult, a as PopoverRotation } from './usePopoverHost-T8QWb2_A.js';
|
|
9
|
+
export { b as PopoverAlign, c as PopoverVerticalAlign, V as ViewInstance, u as useAutoAlign, d as usePopoverHost } from './usePopoverHost-T8QWb2_A.js';
|
|
8
10
|
export { loadSkiaWeb, locateSkiaWebFile } from './skia/index.js';
|
|
9
|
-
import { SeedColor } from '@rific/auto-paper';
|
|
10
11
|
import '@tastic/core';
|
|
12
|
+
import '@rific/auto-paper';
|
|
11
13
|
import '@rific/feedback-press';
|
|
12
14
|
|
|
13
15
|
interface UnlockedAchievement {
|
|
@@ -20,7 +22,7 @@ interface AchievementUnlockOwner {
|
|
|
20
22
|
profile?: Profile | null;
|
|
21
23
|
color: string;
|
|
22
24
|
}
|
|
23
|
-
interface Props$
|
|
25
|
+
interface Props$1<Seat extends number> {
|
|
24
26
|
unlocks: Partial<Record<Seat, UnlockedAchievement[]>>;
|
|
25
27
|
seats: readonly Seat[];
|
|
26
28
|
owners: Record<Seat, AchievementUnlockOwner>;
|
|
@@ -28,15 +30,8 @@ interface Props$4<Seat extends number> {
|
|
|
28
30
|
fg?: string;
|
|
29
31
|
style?: ViewStyle;
|
|
30
32
|
}
|
|
31
|
-
declare function AchievementUnlockList<Seat extends number>({ unlocks, seats, owners, tierColors, fg: fgOverride, style }: Props$
|
|
33
|
+
declare function AchievementUnlockList<Seat extends number>({ unlocks, seats, owners, tierColors, fg: fgOverride, style }: Props$1<Seat>): react.JSX.Element | null;
|
|
32
34
|
|
|
33
|
-
interface MenuOption<T extends string | number> {
|
|
34
|
-
value: T;
|
|
35
|
-
label: string;
|
|
36
|
-
description?: string;
|
|
37
|
-
icon?: string;
|
|
38
|
-
iconSize?: number;
|
|
39
|
-
}
|
|
40
35
|
interface SingleSelectSection<T extends string | number> {
|
|
41
36
|
kind: 'single';
|
|
42
37
|
id: string;
|
|
@@ -54,7 +49,7 @@ interface MultiSelectSection<T extends string | number> {
|
|
|
54
49
|
allClear?: boolean;
|
|
55
50
|
}
|
|
56
51
|
type MenuSection = SingleSelectSection<any> | MultiSelectSection<any>;
|
|
57
|
-
interface Props
|
|
52
|
+
interface Props {
|
|
58
53
|
id: string;
|
|
59
54
|
host: PopoverHost;
|
|
60
55
|
icon: string;
|
|
@@ -74,7 +69,7 @@ interface Props$3 {
|
|
|
74
69
|
clear: string;
|
|
75
70
|
};
|
|
76
71
|
}
|
|
77
|
-
declare function SectionedDropdown({ id, host, icon, accessibilityLabel, sections, accentColor, mutedColor, onAccentColor, dark, align: forcedAlign, alignOverride, rotation: rotationOverride, autoDismiss, labelFontFamily, allClearLabels }: Props
|
|
72
|
+
declare function SectionedDropdown({ id, host, icon, accessibilityLabel, sections, accentColor, mutedColor, onAccentColor, dark, align: forcedAlign, alignOverride, rotation: rotationOverride, autoDismiss, labelFontFamily, allClearLabels }: Props): react.JSX.Element;
|
|
78
73
|
|
|
79
74
|
interface ControlSchemePickerProps<T extends string | number> {
|
|
80
75
|
id: string;
|
|
@@ -106,84 +101,6 @@ interface CornerStatusBadgesProps {
|
|
|
106
101
|
}
|
|
107
102
|
declare function CornerStatusBadges({ orientationMode, p1OnRight, p1, p2 }: CornerStatusBadgesProps): react.JSX.Element;
|
|
108
103
|
|
|
109
|
-
declare const LABELED_DROPDOWN_POPOVER_WIDTH = 180;
|
|
110
|
-
declare function getLabeledDropdownContentHeight(optionCount: number): number;
|
|
111
|
-
interface LabeledDropdownOption<T extends string> {
|
|
112
|
-
value: T;
|
|
113
|
-
label: string;
|
|
114
|
-
icon?: string;
|
|
115
|
-
}
|
|
116
|
-
interface Props$2<T extends string> {
|
|
117
|
-
id: string;
|
|
118
|
-
host: PopoverHost;
|
|
119
|
-
options: LabeledDropdownOption<T>[];
|
|
120
|
-
value: T;
|
|
121
|
-
onChange: (value: T) => void;
|
|
122
|
-
color: string;
|
|
123
|
-
dark: boolean;
|
|
124
|
-
align?: 'left' | 'right' | 'center';
|
|
125
|
-
alignOverride?: AlignResult;
|
|
126
|
-
}
|
|
127
|
-
declare function LabeledDropdown<T extends string>({ id, host, options, value, onChange, color, dark, align: forcedAlign, alignOverride }: Props$2<T>): react.JSX.Element;
|
|
128
|
-
|
|
129
|
-
declare function getColorPopoverId(idPrefix: string): string;
|
|
130
|
-
declare function getProfilePopoverId(idPrefix: string): string;
|
|
131
|
-
declare function getCpuDifficultyPopoverId(idPrefix: string): string;
|
|
132
|
-
interface PlayerSetupPanelProps<C extends string = string> {
|
|
133
|
-
idPrefix: string;
|
|
134
|
-
host?: PopoverHost;
|
|
135
|
-
label?: string;
|
|
136
|
-
labelFontFamily?: string;
|
|
137
|
-
color: string;
|
|
138
|
-
onColorChange: (hex: string) => void;
|
|
139
|
-
swatches: SeedColor[];
|
|
140
|
-
takenColor?: string;
|
|
141
|
-
allowSwapTaken?: boolean;
|
|
142
|
-
colorCaption?: string;
|
|
143
|
-
showColor?: boolean;
|
|
144
|
-
colorAlignOverride?: AlignResult;
|
|
145
|
-
colorRotation?: PopoverRotation;
|
|
146
|
-
isHuman: boolean;
|
|
147
|
-
secondPicker?: ReactNode;
|
|
148
|
-
secondPickerId?: string;
|
|
149
|
-
ready?: boolean;
|
|
150
|
-
onToggleReady?: () => void;
|
|
151
|
-
dark: boolean;
|
|
152
|
-
showReadyButton?: boolean;
|
|
153
|
-
profiles?: Profile[];
|
|
154
|
-
selectedProfileId?: string | null;
|
|
155
|
-
takenProfileId?: string | null;
|
|
156
|
-
guestLabel?: string;
|
|
157
|
-
onProfileSelect?: (profile: Profile | null) => void;
|
|
158
|
-
onManageProfiles?: () => void;
|
|
159
|
-
cpuDifficulty?: C;
|
|
160
|
-
cpuDifficultyOptions?: LabeledDropdownOption<C>[];
|
|
161
|
-
onCpuDifficultyChange?: (value: C) => void;
|
|
162
|
-
humanIcon?: string;
|
|
163
|
-
cpuIcon?: string;
|
|
164
|
-
}
|
|
165
|
-
declare function PlayerSetupPanel<C extends string = string>({ idPrefix, host, label, labelFontFamily, color, onColorChange, swatches, takenColor, allowSwapTaken, colorCaption, showColor, colorAlignOverride, colorRotation, isHuman, secondPicker, secondPickerId, ready, onToggleReady, dark, showReadyButton, profiles, selectedProfileId, takenProfileId, guestLabel, onProfileSelect, onManageProfiles, cpuDifficulty, cpuDifficultyOptions, onCpuDifficultyChange, humanIcon, cpuIcon }: PlayerSetupPanelProps<C>): react.JSX.Element;
|
|
166
|
-
|
|
167
|
-
interface Props$1 {
|
|
168
|
-
color: string;
|
|
169
|
-
ready: boolean;
|
|
170
|
-
onToggleReady: () => void;
|
|
171
|
-
style?: StyleProp<ViewStyle>;
|
|
172
|
-
labelFontFamily?: string;
|
|
173
|
-
}
|
|
174
|
-
declare function ReadyButton({ color, ready, onToggleReady, style, labelFontFamily }: Props$1): react.JSX.Element;
|
|
175
|
-
|
|
176
|
-
interface Props {
|
|
177
|
-
onBack: () => void;
|
|
178
|
-
onSettings: () => void;
|
|
179
|
-
onRandomize?: () => void;
|
|
180
|
-
onReset?: () => void;
|
|
181
|
-
fg: string;
|
|
182
|
-
popoverOpen: boolean;
|
|
183
|
-
children: ReactNode;
|
|
184
|
-
}
|
|
185
|
-
declare function SharedActionBand({ onBack, onSettings, onRandomize, onReset, fg, popoverOpen, children }: Props): react.JSX.Element;
|
|
186
|
-
|
|
187
104
|
interface TriggerGaugeProps {
|
|
188
105
|
segments: number;
|
|
189
106
|
litIndices: number[];
|
|
@@ -207,6 +124,4 @@ interface QuitConfirmation {
|
|
|
207
124
|
}
|
|
208
125
|
declare function useQuitConfirmation(hasProgress: () => boolean, onConfirmedBack: () => void): QuitConfirmation;
|
|
209
126
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
export { AchievementUnlockList, type AchievementUnlockOwner, AlignResult, ControlSchemePicker, type ControlSchemePickerProps, type CornerStatusBadgeSeat, CornerStatusBadges, type CornerStatusBadgesProps, LABELED_DROPDOWN_POPOVER_WIDTH, LabeledDropdown, type LabeledDropdownOption, type MenuOption, type MenuSection, type MultiSelectSection, type OrientationMode, PlayerSetupPanel, type PlayerSetupPanelProps, PopoverHost, PopoverRotation, type QuitConfirmation, ReadyButton, SectionedDropdown, SharedActionBand, type SingleSelectSection, TriggerGaugeHost, type TriggerGaugeProps, type UnlockedAchievement, getColorPopoverId, getCpuDifficultyPopoverId, getLabeledDropdownContentHeight, getProfilePopoverId, useAutoAlign, useQuitConfirmation, useZoneClampedAlign };
|
|
127
|
+
export { AchievementUnlockList, type AchievementUnlockOwner, AlignResult, ControlSchemePicker, type ControlSchemePickerProps, type CornerStatusBadgeSeat, CornerStatusBadges, type CornerStatusBadgesProps, MenuOption, type MenuSection, type MultiSelectSection, type OrientationMode, PopoverHost, PopoverRotation, type QuitConfirmation, SectionedDropdown, type SingleSelectSection, TriggerGaugeHost, type TriggerGaugeProps, type UnlockedAchievement, useQuitConfirmation };
|
package/dist/index.js
CHANGED
|
@@ -1810,7 +1810,7 @@ function getProfilePopoverId(idPrefix) {
|
|
|
1810
1810
|
function getCpuDifficultyPopoverId(idPrefix) {
|
|
1811
1811
|
return `${idPrefix}-difficulty`;
|
|
1812
1812
|
}
|
|
1813
|
-
function PlayerSetupPanel({ idPrefix, host, label, labelFontFamily, color, onColorChange, swatches, takenColor, allowSwapTaken, colorCaption, showColor = true, colorAlignOverride, colorRotation, isHuman, secondPicker, secondPickerId, ready, onToggleReady, dark, showReadyButton = true, profiles, selectedProfileId, takenProfileId, guestLabel, onProfileSelect, onManageProfiles, cpuDifficulty, cpuDifficultyOptions, onCpuDifficultyChange, humanIcon = "face-man", cpuIcon = "robot" }) {
|
|
1813
|
+
function PlayerSetupPanel({ idPrefix, host, label, labelFontFamily, color, onColorChange, swatches, takenColor, allowSwapTaken, colorCaption, showColor = true, colorAlignOverride, colorRotation, isHuman, secondPicker, secondPickerId, ready, onToggleReady, dark, showReadyButton = true, profiles, selectedProfileId, takenProfileId, guestLabel, nullLabel, onProfileSelect, onManageProfiles, cpuDifficulty, cpuDifficultyOptions, onCpuDifficultyChange, humanIcon = "face-man", cpuIcon = "robot", previewValue, triggerStyle, useSeatPickerAlign }) {
|
|
1814
1814
|
const ownHost = usePopoverHost();
|
|
1815
1815
|
const popover = host ?? ownHost;
|
|
1816
1816
|
const ownPopoverOpen = popover.openId?.startsWith(`${idPrefix}-`) ?? false;
|
|
@@ -1819,17 +1819,19 @@ function PlayerSetupPanel({ idPrefix, host, label, labelFontFamily, color, onCol
|
|
|
1819
1819
|
const showCpuDifficulty = !isHuman && cpuDifficulty !== void 0 && cpuDifficultyOptions !== void 0 && !!onCpuDifficultyChange;
|
|
1820
1820
|
const seatButton = showProfilePicker || showCpuDifficulty;
|
|
1821
1821
|
const selectedProfile = profiles?.find((p) => p.id === selectedProfileId) ?? null;
|
|
1822
|
-
const
|
|
1822
|
+
const drawn = previewValue ? previewValue(color) : color;
|
|
1823
|
+
const colorSection = showColor ? { value: color, onChange: onColorChange, swatches, takenValue: takenColor, allowSwapTaken, caption: showProfilePicker && selectedProfile ? colorCaption : void 0, previewValue } : void 0;
|
|
1823
1824
|
const seatPickerId = showProfilePicker ? getProfilePopoverId(idPrefix) : getCpuDifficultyPopoverId(idPrefix);
|
|
1824
1825
|
const seatPickerSize = showProfilePicker ? (0, import_profile2.getProfilePickerContentSize)(profiles.length, !!onManageProfiles, colorSection) : (0, import_profile2.getOptionPickerContentSize)(cpuDifficultyOptions?.length ?? 0, colorSection);
|
|
1825
|
-
const
|
|
1826
|
+
const useSeatAlign = useSeatPickerAlign ?? useZoneClampedAlign;
|
|
1827
|
+
const seatPickerAlign = useSeatAlign(seatButton && popover.openId === seatPickerId, seatPickerSize.width, seatPickerSize.height);
|
|
1826
1828
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react_native27.View, { style: [styles21.panel, ownPopoverOpen && styles21.panelOpen], children: [
|
|
1827
|
-
showProfilePicker ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_profile2.ProfilePicker, { idPrefix, host: popover, profiles, selectedId: selectedProfileId ?? null, takenId: takenProfileId, color, dark, guestLabel: guestLabel ?? "GUEST", onSelect: (profile) => onProfileSelect?.(profile), onManage: onManageProfiles, colorSection, alignOverride: seatPickerAlign }) : showCpuDifficulty ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_profile2.OptionPicker, { id: getCpuDifficultyPopoverId(idPrefix), host: popover, options: cpuDifficultyOptions, value: cpuDifficulty, onChange: onCpuDifficultyChange, color, dark, icon: cpuIcon, colorSection, alignOverride: seatPickerAlign }) : label && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_native_paper16.Text, { variant: "labelSmall", style: { color, fontFamily: labelFontFamily }, children: label }),
|
|
1829
|
+
showProfilePicker ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_profile2.ProfilePicker, { idPrefix, host: popover, profiles, selectedId: selectedProfileId ?? null, takenId: takenProfileId, color: drawn, dark, guestLabel: guestLabel ?? "GUEST", nullLabel, onSelect: (profile) => onProfileSelect?.(profile), onManage: onManageProfiles, colorSection, alignOverride: seatPickerAlign, triggerStyle }) : showCpuDifficulty ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_profile2.OptionPicker, { id: getCpuDifficultyPopoverId(idPrefix), host: popover, options: cpuDifficultyOptions, value: cpuDifficulty, onChange: onCpuDifficultyChange, color: drawn, dark, icon: cpuIcon, colorSection, alignOverride: seatPickerAlign, triggerStyle }) : label && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_native_paper16.Text, { variant: "labelSmall", style: { color: drawn, fontFamily: labelFontFamily }, children: label }),
|
|
1828
1830
|
(!seatButton || secondPicker) && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react_native27.View, { style: [styles21.pickerRow, pickerRowPopoverOpen && styles21.pickerRowOpen], children: [
|
|
1829
|
-
!seatButton && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(InlineColorPicker, { id: getColorPopoverId(idPrefix), host: popover, value: color, onChange: onColorChange, swatches, takenValue: takenColor, allowSwapTaken, alignOverride: colorAlignOverride, rotation: colorRotation, dark, tag: isHuman ? selectedProfile?.tag : void 0, icon: isHuman ? humanIcon : cpuIcon }),
|
|
1831
|
+
!seatButton && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(InlineColorPicker, { id: getColorPopoverId(idPrefix), host: popover, value: color, onChange: onColorChange, swatches, takenValue: takenColor, allowSwapTaken, previewValue, alignOverride: colorAlignOverride, rotation: colorRotation, dark, tag: isHuman ? selectedProfile?.tag : void 0, icon: isHuman ? humanIcon : cpuIcon }),
|
|
1830
1832
|
secondPicker
|
|
1831
1833
|
] }),
|
|
1832
|
-
isHuman && showReadyButton && onToggleReady && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ReadyButton, { color, ready: ready ?? false, onToggleReady })
|
|
1834
|
+
isHuman && showReadyButton && onToggleReady && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ReadyButton, { color: drawn, ready: ready ?? false, onToggleReady })
|
|
1833
1835
|
] });
|
|
1834
1836
|
}
|
|
1835
1837
|
var styles21 = import_react_native27.StyleSheet.create({
|
package/dist/index.mjs
CHANGED
|
@@ -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,31 @@ 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-
|
|
21
|
+
} from "./chunk-JBE7IQC5.mjs";
|
|
22
|
+
import {
|
|
23
|
+
loadSkiaWeb,
|
|
24
|
+
locateSkiaWebFile
|
|
25
|
+
} from "./chunk-3TCJHMJP.mjs";
|
|
26
|
+
import {
|
|
27
|
+
PlayerSetupPanel,
|
|
28
|
+
ReadyButton,
|
|
29
|
+
SharedActionBand,
|
|
30
|
+
getColorPopoverId,
|
|
31
|
+
getCpuDifficultyPopoverId,
|
|
32
|
+
getProfilePopoverId,
|
|
33
|
+
useZoneClampedAlign
|
|
34
|
+
} from "./chunk-B2DSHZJT.mjs";
|
|
35
|
+
import {
|
|
36
|
+
InlineColorPicker,
|
|
37
|
+
MONO_FONT,
|
|
38
|
+
PopoverBody,
|
|
39
|
+
getInlineColorPickerContentSize,
|
|
40
|
+
useAutoAlign,
|
|
41
|
+
usePopoverHost
|
|
42
|
+
} from "./chunk-FOJLQMKA.mjs";
|
|
28
43
|
import {
|
|
29
44
|
COMPACT_DIALOG_HEIGHT,
|
|
30
45
|
DialogHeader,
|
|
@@ -36,10 +51,6 @@ import {
|
|
|
36
51
|
overlayStyles,
|
|
37
52
|
useOverlayCardColors
|
|
38
53
|
} from "./chunk-CBH7GQKI.mjs";
|
|
39
|
-
import {
|
|
40
|
-
loadSkiaWeb,
|
|
41
|
-
locateSkiaWebFile
|
|
42
|
-
} from "./chunk-3TCJHMJP.mjs";
|
|
43
54
|
|
|
44
55
|
// src/AchievementUnlockList.tsx
|
|
45
56
|
import { getContrastColor, useAutoPaperTheme } from "@rific/auto-paper";
|
|
@@ -437,177 +448,16 @@ var styles4 = StyleSheet4.create({
|
|
|
437
448
|
}
|
|
438
449
|
});
|
|
439
450
|
|
|
440
|
-
// src/PlayerSetupPanel.tsx
|
|
441
|
-
import { getOptionPickerContentSize, getProfilePickerContentSize, OptionPicker, ProfilePicker } from "@tastic/profile";
|
|
442
|
-
import { StyleSheet as StyleSheet6, View as View5 } from "react-native";
|
|
443
|
-
import { Text as Text5 } from "react-native-paper";
|
|
444
|
-
|
|
445
|
-
// src/ReadyButton.tsx
|
|
446
|
-
import { TouchableRipple as TouchableRipple3 } from "@rific/feedback-press";
|
|
447
|
-
import { StyleSheet as StyleSheet5 } from "react-native";
|
|
448
|
-
import { Text as Text4 } from "react-native-paper";
|
|
449
|
-
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
450
|
-
function ReadyButton({ color, ready, onToggleReady, style, labelFontFamily = MONO_FONT }) {
|
|
451
|
-
const readyButtonStyle = [styles5.readyButton, { borderColor: color }, ready && { backgroundColor: color }, style];
|
|
452
|
-
const labelTextStyle = { fontFamily: labelFontFamily, fontWeight: "bold" };
|
|
453
|
-
const labelColorStyle = { color: ready ? "#000000" : color };
|
|
454
|
-
return /* @__PURE__ */ jsx7(TouchableRipple3, { onPress: onToggleReady, borderless: true, style: readyButtonStyle, children: /* @__PURE__ */ jsx7(Text4, { variant: "labelLarge", style: [labelTextStyle, labelColorStyle], children: ready ? "READY \u2713" : "READY?" }) });
|
|
455
|
-
}
|
|
456
|
-
var styles5 = StyleSheet5.create({
|
|
457
|
-
readyButton: {
|
|
458
|
-
alignItems: "center",
|
|
459
|
-
borderRadius: 12,
|
|
460
|
-
borderWidth: 1,
|
|
461
|
-
justifyContent: "center",
|
|
462
|
-
minWidth: 120,
|
|
463
|
-
paddingHorizontal: 16,
|
|
464
|
-
paddingVertical: 10
|
|
465
|
-
}
|
|
466
|
-
});
|
|
467
|
-
|
|
468
|
-
// src/useZoneClampedAlign.ts
|
|
469
|
-
import { useZoneBounds } from "@tastic/split-screen";
|
|
470
|
-
import { useEffect, useState } from "react";
|
|
471
|
-
import { useWindowDimensions } from "react-native";
|
|
472
|
-
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
473
|
-
var EDGE_MARGIN = 12;
|
|
474
|
-
function useZoneClampedAlign(open, contentWidth, contentHeight, rotation = 0) {
|
|
475
|
-
const auto = useAutoAlign(open, contentWidth, contentHeight, rotation);
|
|
476
|
-
const zone = useZoneBounds();
|
|
477
|
-
const { height: windowHeight } = useWindowDimensions();
|
|
478
|
-
const insets = useSafeAreaInsets();
|
|
479
|
-
const shouldMeasure = open && auto.measured && zone !== null;
|
|
480
|
-
const [ownBounds, setOwnBounds] = useState(null);
|
|
481
|
-
const [prevShouldMeasure, setPrevShouldMeasure] = useState(shouldMeasure);
|
|
482
|
-
if (shouldMeasure !== prevShouldMeasure) {
|
|
483
|
-
setPrevShouldMeasure(shouldMeasure);
|
|
484
|
-
setOwnBounds(null);
|
|
485
|
-
}
|
|
486
|
-
useEffect(() => {
|
|
487
|
-
if (!shouldMeasure) return;
|
|
488
|
-
auto.triggerRef.current?.measureInWindow((_x, y, _width, height) => {
|
|
489
|
-
const belowShared = zone.zoneSide === "belowShared";
|
|
490
|
-
const awayRoom = belowShared ? windowHeight - insets.bottom - (y + height) - EDGE_MARGIN : y - insets.top - EDGE_MARGIN;
|
|
491
|
-
const towardRoom = belowShared ? y - zone.sharedEdgeY - EDGE_MARGIN : zone.sharedEdgeY - (y + height) - EDGE_MARGIN;
|
|
492
|
-
const useToward = contentHeight > awayRoom && towardRoom > awayRoom;
|
|
493
|
-
let awaySide = belowShared ? "below" : "above";
|
|
494
|
-
let towardSide = belowShared ? "above" : "below";
|
|
495
|
-
if (zone.rotated) {
|
|
496
|
-
awaySide = awaySide === "above" ? "below" : "above";
|
|
497
|
-
towardSide = towardSide === "above" ? "below" : "above";
|
|
498
|
-
}
|
|
499
|
-
setOwnBounds({ maxHeight: Math.max(useToward ? towardRoom : awayRoom, 0), verticalAlign: useToward ? towardSide : awaySide });
|
|
500
|
-
});
|
|
501
|
-
}, [shouldMeasure, zone, auto.triggerRef, contentHeight, windowHeight, insets.top, insets.bottom]);
|
|
502
|
-
if (!zone) return auto;
|
|
503
|
-
if (!ownBounds) return { ...auto, measured: false };
|
|
504
|
-
return { ...auto, maxHeight: ownBounds.maxHeight, measured: auto.measured, verticalAlign: ownBounds.verticalAlign };
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
// src/PlayerSetupPanel.tsx
|
|
508
|
-
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
509
|
-
function getColorPopoverId(idPrefix) {
|
|
510
|
-
return `${idPrefix}-color`;
|
|
511
|
-
}
|
|
512
|
-
function getProfilePopoverId(idPrefix) {
|
|
513
|
-
return `${idPrefix}-profile`;
|
|
514
|
-
}
|
|
515
|
-
function getCpuDifficultyPopoverId(idPrefix) {
|
|
516
|
-
return `${idPrefix}-difficulty`;
|
|
517
|
-
}
|
|
518
|
-
function PlayerSetupPanel({ idPrefix, host, label, labelFontFamily, color, onColorChange, swatches, takenColor, allowSwapTaken, colorCaption, showColor = true, colorAlignOverride, colorRotation, isHuman, secondPicker, secondPickerId, ready, onToggleReady, dark, showReadyButton = true, profiles, selectedProfileId, takenProfileId, guestLabel, onProfileSelect, onManageProfiles, cpuDifficulty, cpuDifficultyOptions, onCpuDifficultyChange, humanIcon = "face-man", cpuIcon = "robot" }) {
|
|
519
|
-
const ownHost = usePopoverHost();
|
|
520
|
-
const popover = host ?? ownHost;
|
|
521
|
-
const ownPopoverOpen = popover.openId?.startsWith(`${idPrefix}-`) ?? false;
|
|
522
|
-
const pickerRowPopoverOpen = popover.openId === getColorPopoverId(idPrefix) || secondPickerId !== void 0 && popover.openId === secondPickerId;
|
|
523
|
-
const showProfilePicker = isHuman && profiles !== void 0 && !!onProfileSelect;
|
|
524
|
-
const showCpuDifficulty = !isHuman && cpuDifficulty !== void 0 && cpuDifficultyOptions !== void 0 && !!onCpuDifficultyChange;
|
|
525
|
-
const seatButton = showProfilePicker || showCpuDifficulty;
|
|
526
|
-
const selectedProfile = profiles?.find((p) => p.id === selectedProfileId) ?? null;
|
|
527
|
-
const colorSection = showColor ? { value: color, onChange: onColorChange, swatches, takenValue: takenColor, allowSwapTaken, caption: showProfilePicker && selectedProfile ? colorCaption : void 0 } : void 0;
|
|
528
|
-
const seatPickerId = showProfilePicker ? getProfilePopoverId(idPrefix) : getCpuDifficultyPopoverId(idPrefix);
|
|
529
|
-
const seatPickerSize = showProfilePicker ? getProfilePickerContentSize(profiles.length, !!onManageProfiles, colorSection) : getOptionPickerContentSize(cpuDifficultyOptions?.length ?? 0, colorSection);
|
|
530
|
-
const seatPickerAlign = useZoneClampedAlign(seatButton && popover.openId === seatPickerId, seatPickerSize.width, seatPickerSize.height);
|
|
531
|
-
return /* @__PURE__ */ jsxs5(View5, { style: [styles6.panel, ownPopoverOpen && styles6.panelOpen], children: [
|
|
532
|
-
showProfilePicker ? /* @__PURE__ */ jsx8(ProfilePicker, { idPrefix, host: popover, profiles, selectedId: selectedProfileId ?? null, takenId: takenProfileId, color, dark, guestLabel: guestLabel ?? "GUEST", onSelect: (profile) => onProfileSelect?.(profile), onManage: onManageProfiles, colorSection, alignOverride: seatPickerAlign }) : showCpuDifficulty ? /* @__PURE__ */ jsx8(OptionPicker, { id: getCpuDifficultyPopoverId(idPrefix), host: popover, options: cpuDifficultyOptions, value: cpuDifficulty, onChange: onCpuDifficultyChange, color, dark, icon: cpuIcon, colorSection, alignOverride: seatPickerAlign }) : label && /* @__PURE__ */ jsx8(Text5, { variant: "labelSmall", style: { color, fontFamily: labelFontFamily }, children: label }),
|
|
533
|
-
(!seatButton || secondPicker) && /* @__PURE__ */ jsxs5(View5, { style: [styles6.pickerRow, pickerRowPopoverOpen && styles6.pickerRowOpen], children: [
|
|
534
|
-
!seatButton && /* @__PURE__ */ jsx8(InlineColorPicker, { id: getColorPopoverId(idPrefix), host: popover, value: color, onChange: onColorChange, swatches, takenValue: takenColor, allowSwapTaken, alignOverride: colorAlignOverride, rotation: colorRotation, dark, tag: isHuman ? selectedProfile?.tag : void 0, icon: isHuman ? humanIcon : cpuIcon }),
|
|
535
|
-
secondPicker
|
|
536
|
-
] }),
|
|
537
|
-
isHuman && showReadyButton && onToggleReady && /* @__PURE__ */ jsx8(ReadyButton, { color, ready: ready ?? false, onToggleReady })
|
|
538
|
-
] });
|
|
539
|
-
}
|
|
540
|
-
var styles6 = StyleSheet6.create({
|
|
541
|
-
panel: {
|
|
542
|
-
alignItems: "center",
|
|
543
|
-
gap: 12
|
|
544
|
-
},
|
|
545
|
-
// See SectionedDropdown's anchorOpen comment - this panel is typically a sibling of another
|
|
546
|
-
// panel (and/or a shared-controls row), so a popover escaping this panel's bounds needs the panel
|
|
547
|
-
// itself elevated, not just the popover content, to paint above a later sibling.
|
|
548
|
-
panelOpen: {
|
|
549
|
-
zIndex: 100
|
|
550
|
-
},
|
|
551
|
-
// Same gap as `panel`'s own vertical rhythm, reused horizontally - the fallback color swatch and
|
|
552
|
-
// (when present) secondPicker sit side by side within this row instead of stacked in the panel's
|
|
553
|
-
// own column.
|
|
554
|
-
pickerRow: {
|
|
555
|
-
alignItems: "center",
|
|
556
|
-
flexDirection: "row",
|
|
557
|
-
gap: 12
|
|
558
|
-
},
|
|
559
|
-
// A popover is an absolutely-positioned sibling of its own trigger - so a tall one (the color
|
|
560
|
-
// swatch grid) can extend down far enough to overlap the ReadyButton below, which paints on top of
|
|
561
|
-
// it by default DOM order since it's a later sibling within `panel`. `panel`'s own panelOpen
|
|
562
|
-
// elevation only helps this panel paint above OTHER panels (see its own comment) - it does nothing
|
|
563
|
-
// for stacking *within* this panel, since React Native Web gives each View its own stacking
|
|
564
|
-
// context. This is what actually fixes that: elevate pickerRow itself above its own later sibling
|
|
565
|
-
// whenever one of its own popovers is open.
|
|
566
|
-
pickerRowOpen: {
|
|
567
|
-
zIndex: 100
|
|
568
|
-
}
|
|
569
|
-
});
|
|
570
|
-
|
|
571
|
-
// src/SharedActionBand.tsx
|
|
572
|
-
import { IconButton as IconButton2 } from "@rific/feedback-press";
|
|
573
|
-
import { StyleSheet as StyleSheet7, View as View6 } from "react-native";
|
|
574
|
-
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
575
|
-
function SharedActionBand({ onBack, onSettings, onRandomize, onReset, fg, popoverOpen, children }) {
|
|
576
|
-
return /* @__PURE__ */ jsxs6(View6, { style: [styles7.column, popoverOpen && styles7.columnOpen], children: [
|
|
577
|
-
/* @__PURE__ */ jsxs6(View6, { style: styles7.actionsRow, children: [
|
|
578
|
-
/* @__PURE__ */ jsx9(IconButton2, { icon: "arrow-left", iconColor: fg, size: 20, onPress: onBack, accessibilityLabel: "Back" }),
|
|
579
|
-
onRandomize && /* @__PURE__ */ jsx9(IconButton2, { icon: "dice-multiple", iconColor: fg, size: 18, onPress: onRandomize, accessibilityLabel: "Randomize match settings" }),
|
|
580
|
-
onReset && /* @__PURE__ */ jsx9(IconButton2, { icon: "restore", iconColor: fg, size: 18, onPress: onReset, accessibilityLabel: "Reset match settings to defaults" }),
|
|
581
|
-
/* @__PURE__ */ jsx9(IconButton2, { icon: "cog", iconColor: fg, size: 20, onPress: onSettings, accessibilityLabel: "Settings" })
|
|
582
|
-
] }),
|
|
583
|
-
children
|
|
584
|
-
] });
|
|
585
|
-
}
|
|
586
|
-
var styles7 = StyleSheet7.create({
|
|
587
|
-
actionsRow: {
|
|
588
|
-
alignItems: "center",
|
|
589
|
-
flexDirection: "row",
|
|
590
|
-
gap: 16
|
|
591
|
-
},
|
|
592
|
-
column: {
|
|
593
|
-
alignItems: "center",
|
|
594
|
-
gap: 8
|
|
595
|
-
},
|
|
596
|
-
columnOpen: {
|
|
597
|
-
zIndex: 100
|
|
598
|
-
}
|
|
599
|
-
});
|
|
600
|
-
|
|
601
451
|
// src/useQuitConfirmation.ts
|
|
602
|
-
import { useCallback, useEffect
|
|
452
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
603
453
|
function useQuitConfirmation(hasProgress, onConfirmedBack) {
|
|
604
|
-
const [confirmVisible, setConfirmVisible] =
|
|
454
|
+
const [confirmVisible, setConfirmVisible] = useState(false);
|
|
605
455
|
const hasProgressRef = useRef(hasProgress);
|
|
606
|
-
|
|
456
|
+
useEffect(() => {
|
|
607
457
|
hasProgressRef.current = hasProgress;
|
|
608
458
|
});
|
|
609
459
|
const onConfirmedBackRef = useRef(onConfirmedBack);
|
|
610
|
-
|
|
460
|
+
useEffect(() => {
|
|
611
461
|
onConfirmedBackRef.current = onConfirmedBack;
|
|
612
462
|
});
|
|
613
463
|
const requestBack = useCallback(() => {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { M as MenuOption, P as PlayerSetupPanel, c as PlayerSetupPanelProps, R as ReadyButton, S as SharedActionBand, g as getColorPopoverId, d as getCpuDifficultyPopoverId, f as getProfilePopoverId, u as useZoneClampedAlign } from '../index-Bhu3I6FN.mjs';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '@rific/auto-paper';
|
|
4
|
+
import '@tastic/profile';
|
|
5
|
+
import 'react-native';
|
|
6
|
+
import '../usePopoverHost-T8QWb2_A.mjs';
|
|
7
|
+
import '@tastic/core';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { M as MenuOption, P as PlayerSetupPanel, c as PlayerSetupPanelProps, R as ReadyButton, S as SharedActionBand, g as getColorPopoverId, d as getCpuDifficultyPopoverId, f as getProfilePopoverId, u as useZoneClampedAlign } from '../index-1fnoSjO0.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '@rific/auto-paper';
|
|
4
|
+
import '@tastic/profile';
|
|
5
|
+
import 'react-native';
|
|
6
|
+
import '../usePopoverHost-T8QWb2_A.js';
|
|
7
|
+
import '@tastic/core';
|