@tastic/hud 0.22.0 → 0.23.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 +26 -14
- package/dist/chrome/index.d.mts +87 -18
- package/dist/chrome/index.d.ts +87 -18
- package/dist/chrome/index.js +309 -22
- package/dist/chrome/index.mjs +13 -1
- package/dist/{chunk-N7A7W72S.mjs → chunk-BXG44LIA.mjs} +298 -19
- package/dist/index.d.mts +12 -81
- package/dist/index.d.ts +12 -81
- package/dist/index.js +27 -24
- package/dist/index.mjs +100 -364
- package/package.json +3 -2
- package/src/BaseSettingsDialog.tsx +13 -13
- package/src/chrome/index.ts +12 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import { PopoverHost, AlignResult, PopoverRotation, useAutoAlign } from './chrome/index.js';
|
|
2
|
+
export { AchievementCatalogSection, AchievementRow, ActivityStatSection, BaseSettingsDialog, BaseSettingsDialogProps, BaseStatsScreen, COMPACT_DIALOG_HEIGHT, ConfirmDialog, ConfirmDialogProps, ContentGutter, CornerActionButtons, DialogHeader, DialogHeaderProps, InlineColorPicker, LOCKED_BADGE_COLOR, MONO_FONT, OverlayBackdrop, OverlayBackdropProps, OverlayCard, OverlayCardProps, OverlayCardThemeColors, PopoverAlign, PopoverBody, PopoverVerticalAlign, PressAwayOverlay, RotatedFrame, RotatedFrameProps, StaggeredWord, StaggeredWordProps, StatRow, StatSection, UpdateDialog, UpdateDialogProps, WELL_SHADOW, WellColors, getInlineColorPickerContentSize, getStaggeredWordDuration, isCompactDialogHeight, overlayActionStyles, overlayStyles, useCompactDialog, useOverlayCardColors, usePopoverHost, useWellColors } from './chrome/index.js';
|
|
2
3
|
import * as react from 'react';
|
|
3
|
-
import {
|
|
4
|
+
import { ReactNode } from 'react';
|
|
4
5
|
import { AchievementTier } from '@tastic/achievements';
|
|
5
6
|
import { Profile } from '@tastic/profile';
|
|
6
|
-
import { ViewStyle,
|
|
7
|
-
import { ViewRotation } from '@tastic/core';
|
|
7
|
+
import { ViewStyle, StyleProp } from 'react-native';
|
|
8
8
|
import { SeedColor } from '@rific/auto-paper';
|
|
9
9
|
export { SkiaGate, SkiaGateProps } from './SkiaGate.js';
|
|
10
|
+
import '@tastic/core';
|
|
10
11
|
|
|
11
12
|
interface UnlockedAchievement {
|
|
12
13
|
id: string;
|
|
@@ -18,7 +19,7 @@ interface AchievementUnlockOwner {
|
|
|
18
19
|
profile?: Profile | null;
|
|
19
20
|
color: string;
|
|
20
21
|
}
|
|
21
|
-
interface Props$
|
|
22
|
+
interface Props$4<Seat extends number> {
|
|
22
23
|
unlocks: Partial<Record<Seat, UnlockedAchievement[]>>;
|
|
23
24
|
seats: readonly Seat[];
|
|
24
25
|
owners: Record<Seat, AchievementUnlockOwner>;
|
|
@@ -26,32 +27,7 @@ interface Props$7<Seat extends number> {
|
|
|
26
27
|
fg?: string;
|
|
27
28
|
style?: ViewStyle;
|
|
28
29
|
}
|
|
29
|
-
declare function AchievementUnlockList<Seat extends number>({ unlocks, seats, owners, tierColors, fg: fgOverride, style }: Props$
|
|
30
|
-
|
|
31
|
-
type PopoverAlign = 'left' | 'right' | 'center';
|
|
32
|
-
type PopoverVerticalAlign = 'below' | 'above';
|
|
33
|
-
type PopoverRotation = ViewRotation;
|
|
34
|
-
interface AlignResult {
|
|
35
|
-
align: PopoverAlign;
|
|
36
|
-
verticalAlign: PopoverVerticalAlign;
|
|
37
|
-
maxHeight: number;
|
|
38
|
-
measured: boolean;
|
|
39
|
-
triggerRef: RefObject<View | null>;
|
|
40
|
-
}
|
|
41
|
-
declare function useAutoAlign(open: boolean, contentWidth: number, contentHeight: number, rotation?: PopoverRotation): {
|
|
42
|
-
align: PopoverAlign;
|
|
43
|
-
maxHeight: number;
|
|
44
|
-
measured: boolean;
|
|
45
|
-
triggerRef: RefObject<View | null>;
|
|
46
|
-
verticalAlign: PopoverVerticalAlign;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
interface PopoverHost {
|
|
50
|
-
openId: string | null;
|
|
51
|
-
toggle: (id: string) => void;
|
|
52
|
-
close: () => void;
|
|
53
|
-
}
|
|
54
|
-
declare function usePopoverHost(): PopoverHost;
|
|
30
|
+
declare function AchievementUnlockList<Seat extends number>({ unlocks, seats, owners, tierColors, fg: fgOverride, style }: Props$4<Seat>): react.JSX.Element | null;
|
|
55
31
|
|
|
56
32
|
interface MenuOption<T extends string | number> {
|
|
57
33
|
value: T;
|
|
@@ -77,7 +53,7 @@ interface MultiSelectSection<T extends string | number> {
|
|
|
77
53
|
allClear?: boolean;
|
|
78
54
|
}
|
|
79
55
|
type MenuSection = SingleSelectSection<any> | MultiSelectSection<any>;
|
|
80
|
-
interface Props$
|
|
56
|
+
interface Props$3 {
|
|
81
57
|
id: string;
|
|
82
58
|
host: PopoverHost;
|
|
83
59
|
icon: string;
|
|
@@ -97,7 +73,7 @@ interface Props$6 {
|
|
|
97
73
|
clear: string;
|
|
98
74
|
};
|
|
99
75
|
}
|
|
100
|
-
declare function SectionedDropdown({ id, host, icon, accessibilityLabel, sections, accentColor, mutedColor, onAccentColor, dark, align: forcedAlign, alignOverride, rotation: rotationOverride, autoDismiss, labelFontFamily, allClearLabels }: Props$
|
|
76
|
+
declare function SectionedDropdown({ id, host, icon, accessibilityLabel, sections, accentColor, mutedColor, onAccentColor, dark, align: forcedAlign, alignOverride, rotation: rotationOverride, autoDismiss, labelFontFamily, allClearLabels }: Props$3): react.JSX.Element;
|
|
101
77
|
|
|
102
78
|
interface ControlSchemePickerProps<T extends string | number> {
|
|
103
79
|
id: string;
|
|
@@ -129,32 +105,6 @@ interface CornerStatusBadgesProps {
|
|
|
129
105
|
}
|
|
130
106
|
declare function CornerStatusBadges({ orientationMode, p1OnRight, p1, p2 }: CornerStatusBadgesProps): react.JSX.Element;
|
|
131
107
|
|
|
132
|
-
declare function getInlineColorPickerContentSize(swatchCount: number, windowWidth: number, columns?: number): {
|
|
133
|
-
width: number;
|
|
134
|
-
height: number;
|
|
135
|
-
};
|
|
136
|
-
interface Props$5 {
|
|
137
|
-
id: string;
|
|
138
|
-
host: PopoverHost;
|
|
139
|
-
value: string;
|
|
140
|
-
onChange: (hex: string) => void;
|
|
141
|
-
previewValue?: (hex: string) => string;
|
|
142
|
-
swatches?: SeedColor[];
|
|
143
|
-
takenValue?: string;
|
|
144
|
-
allowSwapTaken?: boolean;
|
|
145
|
-
dark: boolean;
|
|
146
|
-
align?: 'left' | 'right' | 'center';
|
|
147
|
-
alignOverride?: AlignResult;
|
|
148
|
-
rotation?: PopoverRotation;
|
|
149
|
-
icon?: string;
|
|
150
|
-
tag?: string;
|
|
151
|
-
labelFontFamily?: string;
|
|
152
|
-
autoDismiss?: boolean;
|
|
153
|
-
columns?: number;
|
|
154
|
-
size?: number;
|
|
155
|
-
}
|
|
156
|
-
declare function InlineColorPicker({ id, host, value, onChange, previewValue, swatches, takenValue, allowSwapTaken, dark, align: forcedAlign, alignOverride, rotation: rotationOverride, icon, tag, labelFontFamily, autoDismiss, columns, size }: Props$5): react.JSX.Element;
|
|
157
|
-
|
|
158
108
|
declare const LABELED_DROPDOWN_POPOVER_WIDTH = 180;
|
|
159
109
|
declare function getLabeledDropdownContentHeight(optionCount: number): number;
|
|
160
110
|
interface LabeledDropdownOption<T extends string> {
|
|
@@ -162,7 +112,7 @@ interface LabeledDropdownOption<T extends string> {
|
|
|
162
112
|
label: string;
|
|
163
113
|
icon?: string;
|
|
164
114
|
}
|
|
165
|
-
interface Props$
|
|
115
|
+
interface Props$2<T extends string> {
|
|
166
116
|
id: string;
|
|
167
117
|
host: PopoverHost;
|
|
168
118
|
options: LabeledDropdownOption<T>[];
|
|
@@ -173,7 +123,7 @@ interface Props$4<T extends string> {
|
|
|
173
123
|
align?: 'left' | 'right' | 'center';
|
|
174
124
|
alignOverride?: AlignResult;
|
|
175
125
|
}
|
|
176
|
-
declare function LabeledDropdown<T extends string>({ id, host, options, value, onChange, color, dark, align: forcedAlign, alignOverride }: Props$
|
|
126
|
+
declare function LabeledDropdown<T extends string>({ id, host, options, value, onChange, color, dark, align: forcedAlign, alignOverride }: Props$2<T>): react.JSX.Element;
|
|
177
127
|
|
|
178
128
|
declare function loadSkiaWeb(): Promise<void>;
|
|
179
129
|
|
|
@@ -215,25 +165,6 @@ interface PlayerSetupPanelProps<C extends string = string> {
|
|
|
215
165
|
}
|
|
216
166
|
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;
|
|
217
167
|
|
|
218
|
-
interface Props$3 {
|
|
219
|
-
visible: boolean;
|
|
220
|
-
children: ReactNode;
|
|
221
|
-
align?: 'left' | 'right' | 'center';
|
|
222
|
-
verticalAlign?: 'below' | 'above';
|
|
223
|
-
caretColor?: string;
|
|
224
|
-
caretBorderColor?: string;
|
|
225
|
-
caretBorderWidth?: number;
|
|
226
|
-
triggerSize?: number;
|
|
227
|
-
}
|
|
228
|
-
declare function PopoverBody({ visible, children, align, verticalAlign, caretColor, caretBorderColor, caretBorderWidth, triggerSize }: Props$3): react.JSX.Element | null;
|
|
229
|
-
|
|
230
|
-
interface Props$2 {
|
|
231
|
-
active: boolean;
|
|
232
|
-
onPress: () => void;
|
|
233
|
-
style?: StyleProp<ViewStyle>;
|
|
234
|
-
}
|
|
235
|
-
declare function PressAwayOverlay({ active, onPress, style }: Props$2): react.JSX.Element | null;
|
|
236
|
-
|
|
237
168
|
interface Props$1 {
|
|
238
169
|
color: string;
|
|
239
170
|
ready: boolean;
|
|
@@ -279,4 +210,4 @@ declare function useQuitConfirmation(hasProgress: () => boolean, onConfirmedBack
|
|
|
279
210
|
|
|
280
211
|
declare function useZoneClampedAlign(open: boolean, contentWidth: number, contentHeight: number, rotation?: PopoverRotation): ReturnType<typeof useAutoAlign>;
|
|
281
212
|
|
|
282
|
-
export { AchievementUnlockList, type AchievementUnlockOwner,
|
|
213
|
+
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, loadSkiaWeb, useAutoAlign, useQuitConfirmation, useZoneClampedAlign };
|
package/dist/index.js
CHANGED
|
@@ -82,7 +82,7 @@ function TriggerGauge({ segments, litIndices, size, accentColor, mutedColor, das
|
|
|
82
82
|
if (mountProgress.value < 1) {
|
|
83
83
|
const startFrac = i * MOUNT_STAGGER_MS / totalDurationMs;
|
|
84
84
|
const endFrac = startFrac + MOUNT_DURATION_MS / totalDurationMs;
|
|
85
|
-
local = (0,
|
|
85
|
+
local = (0, import_core8.clamp)((mountProgress.value - startFrac) / (endFrac - startFrac), 0, 1);
|
|
86
86
|
}
|
|
87
87
|
const sweep = dashAngleDeg * local;
|
|
88
88
|
if (sweep <= 0) continue;
|
|
@@ -106,7 +106,7 @@ function TriggerGauge({ segments, litIndices, size, accentColor, mutedColor, das
|
|
|
106
106
|
if (!isLitNow) continue;
|
|
107
107
|
const startFrac = i * MOUNT_STAGGER_MS / totalDurationMs;
|
|
108
108
|
const endFrac = startFrac + MOUNT_DURATION_MS / totalDurationMs;
|
|
109
|
-
local = (0,
|
|
109
|
+
local = (0, import_core8.clamp)((mountProgress.value - startFrac) / (endFrac - startFrac), 0, 1);
|
|
110
110
|
} else if (isLitNow === wasLit) {
|
|
111
111
|
local = 1;
|
|
112
112
|
} else if (isLitNow) {
|
|
@@ -135,12 +135,12 @@ function TriggerGauge({ segments, litIndices, size, accentColor, mutedColor, das
|
|
|
135
135
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native_skia.Path, { path: litPath, style: "stroke", strokeWidth: LIT_THICKNESS, strokeCap: "round", color: accentColor, opacity: 1 })
|
|
136
136
|
] }) });
|
|
137
137
|
}
|
|
138
|
-
var import_react_native_skia,
|
|
138
|
+
var import_react_native_skia, import_core8, import_react9, import_react_native17, import_react_native_reanimated, import_jsx_runtime16, UNLIT_THICKNESS, LIT_THICKNESS, DASH_GAP_PX, ARC_GAP, DEFAULT_START_DEG, MIN_DASH_ANGLE_DEG, MOUNT_DURATION_MS, MOUNT_STAGGER_MS, SELECTION_TRANSITION_DURATION_MS, styles14;
|
|
139
139
|
var init_TriggerGauge = __esm({
|
|
140
140
|
"src/TriggerGauge.tsx"() {
|
|
141
141
|
"use strict";
|
|
142
142
|
import_react_native_skia = require("@shopify/react-native-skia");
|
|
143
|
-
|
|
143
|
+
import_core8 = require("@tastic/core");
|
|
144
144
|
import_react9 = require("react");
|
|
145
145
|
import_react_native17 = require("react-native");
|
|
146
146
|
import_react_native_reanimated = require("react-native-reanimated");
|
|
@@ -437,9 +437,10 @@ function ActivityStatSection({ stats, fg, fgMuted, sectionBg }) {
|
|
|
437
437
|
|
|
438
438
|
// src/BaseSettingsDialog.tsx
|
|
439
439
|
var import_auto_paper7 = require("@rific/auto-paper");
|
|
440
|
+
var import_core4 = require("@rific/core");
|
|
440
441
|
var import_feedback_press2 = require("@rific/feedback-press");
|
|
441
442
|
var import_updater = require("@rific/updater");
|
|
442
|
-
var
|
|
443
|
+
var import_core5 = require("@tastic/core");
|
|
443
444
|
var import_react6 = require("react");
|
|
444
445
|
var import_react_native13 = require("react-native");
|
|
445
446
|
var import_react_native_paper9 = require("react-native-paper");
|
|
@@ -704,18 +705,20 @@ var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
|
704
705
|
function SettingIcon({ source, color, containerColor }) {
|
|
705
706
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native13.View, { style: [styles10.iconBadge, { backgroundColor: containerColor }], children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native_paper9.Icon, { source, size: 18, color }) });
|
|
706
707
|
}
|
|
707
|
-
function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, version, lockOrientation, onLockOrientationChange, deferBottomEdgeGestures, onDeferBottomEdgeGestures,
|
|
708
|
+
function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, version, lockOrientation, onLockOrientationChange, deferBottomEdgeGestures, onDeferBottomEdgeGestures, hideSound = false, hideHaptics = false, hideAppearance = false, hideUpdateCheck = false, onUpdateError, onShowHowToPlay, children }) {
|
|
708
709
|
const { colors } = (0, import_auto_paper7.useAutoPaperTheme)();
|
|
709
|
-
const ambientRotation = (0,
|
|
710
|
+
const ambientRotation = (0, import_core5.useRotation)();
|
|
710
711
|
const rotation = rotationOverride ?? ambientRotation;
|
|
711
712
|
const window = (0, import_react_native13.useWindowDimensions)();
|
|
712
713
|
const turned = rotation === 90 || rotation === -90;
|
|
713
714
|
const compactHeader = isCompactDialogHeight(turned ? window.width : window.height);
|
|
714
|
-
const insets = (0,
|
|
715
|
+
const insets = (0, import_core5.rotateInsets)((0, import_react_native_safe_area_context2.useSafeAreaInsets)(), rotation);
|
|
715
716
|
const sheetWidth = Math.min(overlayStyles.card.maxWidth, (turned ? window.height : window.width) - 2 * Math.max(insets.left, insets.right, SHEET_GUTTER));
|
|
716
|
-
const isTouchPrimary = (0,
|
|
717
|
+
const isTouchPrimary = (0, import_core5.useIsTouchPrimaryDevice)();
|
|
717
718
|
const { settings: hapticSettings, set: setHapticSettings } = (0, import_feedback_press2.useHapticSettings)();
|
|
718
719
|
const { settings: soundSettings, set: setSoundSettings } = (0, import_feedback_press2.useSoundSettings)();
|
|
720
|
+
const { settings: keepAwakeSettings, set: setKeepAwakeSettings } = (0, import_core4.useKeepAwakeSettings)();
|
|
721
|
+
const expoKeepAwake = (0, import_core4.useExpoKeepAwake)();
|
|
719
722
|
const sound = (0, import_react6.useContext)(import_feedback_press2.SoundContext);
|
|
720
723
|
const { forceShort: forceHapticFeedback } = (0, import_feedback_press2.useVibration)();
|
|
721
724
|
const { settings: themeSettings, set: setThemeSettings } = (0, import_auto_paper7.useThemeSettings)();
|
|
@@ -734,7 +737,7 @@ function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, ve
|
|
|
734
737
|
if (visible && !opened) setOpened(true);
|
|
735
738
|
const showLockOrientation = isTouchPrimary && lockOrientation !== void 0 && onLockOrientationChange !== void 0;
|
|
736
739
|
const showEdgeGuard = import_react_native13.Platform.OS === "ios" && deferBottomEdgeGestures !== void 0 && onDeferBottomEdgeGestures !== void 0;
|
|
737
|
-
const showKeepAwake = isTouchPrimary &&
|
|
740
|
+
const showKeepAwake = isTouchPrimary && expoKeepAwake !== void 0;
|
|
738
741
|
const showHaptics = import_react_native13.Platform.OS !== "web" && !hideHaptics;
|
|
739
742
|
const showSound = !hideSound;
|
|
740
743
|
const showAppearance = !hideAppearance;
|
|
@@ -761,8 +764,8 @@ function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, ve
|
|
|
761
764
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native_paper9.Text, { variant: "bodySmall", numberOfLines: 1, style: { color: colors.onSurfaceVariant }, children: "Require second swipe" })
|
|
762
765
|
] })
|
|
763
766
|
] }) }),
|
|
764
|
-
showKeepAwake && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_feedback_press2.TouchableRipple, { onPress: () =>
|
|
765
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SettingIcon, { source:
|
|
767
|
+
showKeepAwake && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_feedback_press2.TouchableRipple, { onPress: () => setKeepAwakeSettings({ enabled: !keepAwakeSettings.enabled }), style: styles10.toggleButton, accessibilityLabel: `Keep awake ${keepAwakeSettings.enabled ? "on" : "off"}`, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native13.View, { style: styles10.toggleContent, children: [
|
|
768
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SettingIcon, { source: keepAwakeSettings.enabled ? "eye" : "eye-closed", color: keepAwakeSettings.enabled ? colors.tertiary : colors.onSurfaceVariant, containerColor: keepAwakeSettings.enabled ? colors.tertiaryContainer : colors.surfaceVariant }),
|
|
766
769
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native13.View, { style: styles10.flexShrink, children: [
|
|
767
770
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native_paper9.Text, { variant: "bodyLarge", style: { color: colors.onSurface }, children: "Keep Awake" }),
|
|
768
771
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native_paper9.Text, { variant: "bodySmall", numberOfLines: 1, style: { color: colors.onSurfaceVariant }, children: "Stop auto-lock mid-match" })
|
|
@@ -938,14 +941,14 @@ var styles10 = import_react_native13.StyleSheet.create({
|
|
|
938
941
|
// src/BaseStatsScreen.tsx
|
|
939
942
|
var import_auto_paper8 = require("@rific/auto-paper");
|
|
940
943
|
var import_feedback_press3 = require("@rific/feedback-press");
|
|
941
|
-
var
|
|
944
|
+
var import_core6 = require("@tastic/core");
|
|
942
945
|
var import_react7 = require("react");
|
|
943
946
|
var import_react_native14 = require("react-native");
|
|
944
947
|
var import_react_native_paper10 = require("react-native-paper");
|
|
945
948
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
946
949
|
function BaseStatsScreen({ rotation: rotationOverride, title = "Achievements", titleVariant = "headlineSmall", onBack, backLabel = "Back", hitSlop, insets, onReset, resetLabel = "Reset All Stats", resetConfirmTitle = "Reset Everything?", resetConfirmBody = "This permanently erases all stats and achievements. This cannot be undone.", fg: fgOverride, bg: bgOverride, children }) {
|
|
947
950
|
const { dark, colors } = (0, import_auto_paper8.useAutoPaperTheme)();
|
|
948
|
-
const ambientRotation = (0,
|
|
951
|
+
const ambientRotation = (0, import_core6.useRotation)();
|
|
949
952
|
const rotation = rotationOverride ?? ambientRotation;
|
|
950
953
|
const [confirmResetVisible, setConfirmResetVisible] = (0, import_react7.useState)(false);
|
|
951
954
|
const showReset = !!onReset;
|
|
@@ -1011,12 +1014,12 @@ var styles11 = import_react_native14.StyleSheet.create({
|
|
|
1011
1014
|
});
|
|
1012
1015
|
|
|
1013
1016
|
// src/ContentGutter.tsx
|
|
1014
|
-
var
|
|
1017
|
+
var import_core7 = require("@tastic/core");
|
|
1015
1018
|
var import_react_native15 = require("react-native");
|
|
1016
1019
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1017
1020
|
function ContentGutter({ maxContentWidth, leftGutter, rightGutter, style, children }) {
|
|
1018
|
-
const { width: windowWidth } = (0,
|
|
1019
|
-
const { contentWidth, gutterWidth } = (0,
|
|
1021
|
+
const { width: windowWidth } = (0, import_core7.useRotatedWindowDimensions)();
|
|
1022
|
+
const { contentWidth, gutterWidth } = (0, import_core7.computeContentBounds)(windowWidth, maxContentWidth ?? Infinity);
|
|
1020
1023
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native15.View, { style: [styles12.row, style], children: [
|
|
1021
1024
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.View, { style: [styles12.gutter, { width: gutterWidth }], children: leftGutter }),
|
|
1022
1025
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native15.View, { style: { width: contentWidth }, children }),
|
|
@@ -1035,13 +1038,13 @@ var styles12 = import_react_native15.StyleSheet.create({
|
|
|
1035
1038
|
});
|
|
1036
1039
|
|
|
1037
1040
|
// src/ControlSchemePicker.tsx
|
|
1038
|
-
var
|
|
1041
|
+
var import_core10 = require("@tastic/core");
|
|
1039
1042
|
var import_react_native20 = require("react-native");
|
|
1040
1043
|
|
|
1041
1044
|
// src/SectionedDropdown.tsx
|
|
1042
1045
|
var import_auto_paper9 = require("@rific/auto-paper");
|
|
1043
1046
|
var import_feedback_press4 = require("@rific/feedback-press");
|
|
1044
|
-
var
|
|
1047
|
+
var import_core9 = require("@tastic/core");
|
|
1045
1048
|
var import_react_native19 = require("react-native");
|
|
1046
1049
|
var import_react_native_paper11 = require("react-native-paper");
|
|
1047
1050
|
|
|
@@ -1197,7 +1200,7 @@ var MENU_ITEM_HEIGHT_WITH_DESCRIPTION = 58;
|
|
|
1197
1200
|
var MENU_DIVIDER_HEIGHT = 9;
|
|
1198
1201
|
var MENU_VERTICAL_PADDING = 12;
|
|
1199
1202
|
function SectionedDropdown({ id, host, icon, accessibilityLabel, sections, accentColor, mutedColor, onAccentColor, dark, align: forcedAlign, alignOverride, rotation: rotationOverride, autoDismiss = true, labelFontFamily = MONO_FONT, allClearLabels = { all: "All", clear: "Clear" } }) {
|
|
1200
|
-
const ambientRotation = (0,
|
|
1203
|
+
const ambientRotation = (0, import_core9.useRotation)();
|
|
1201
1204
|
const rotation = rotationOverride ?? ambientRotation;
|
|
1202
1205
|
const menuBg = dark ? "#000000" : "#FFFFFF";
|
|
1203
1206
|
const menuBorderColor = (0, import_auto_paper9.getBlendedColor)(mutedColor, menuBg, 0.5);
|
|
@@ -1383,7 +1386,7 @@ var styles15 = import_react_native19.StyleSheet.create({
|
|
|
1383
1386
|
// src/ControlSchemePicker.tsx
|
|
1384
1387
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1385
1388
|
function ControlSchemePicker({ id, host, value, onChange, options, takenValue, accentColor, mutedColor, onAccentColor, dark, align, alignOverride, rotation, labelFontFamily }) {
|
|
1386
|
-
const isTouchPrimary = (0,
|
|
1389
|
+
const isTouchPrimary = (0, import_core10.useIsTouchPrimaryDevice)();
|
|
1387
1390
|
if (import_react_native20.Platform.OS !== "web" || isTouchPrimary) return null;
|
|
1388
1391
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SectionedDropdown, { id, host, icon: "keyboard-outline", accessibilityLabel: "Control scheme", sections: [{ kind: "single", id: "controls", options, value, onChange, takenValue }], accentColor, mutedColor, onAccentColor, dark, align, alignOverride, rotation, labelFontFamily });
|
|
1389
1392
|
}
|
|
@@ -1444,7 +1447,7 @@ var styles17 = import_react_native22.StyleSheet.create({
|
|
|
1444
1447
|
// src/InlineColorPicker.tsx
|
|
1445
1448
|
var import_auto_paper10 = require("@rific/auto-paper");
|
|
1446
1449
|
var import_feedback_press6 = require("@rific/feedback-press");
|
|
1447
|
-
var
|
|
1450
|
+
var import_core11 = require("@tastic/core");
|
|
1448
1451
|
var import_react_native23 = require("react-native");
|
|
1449
1452
|
var import_react_native_paper13 = require("react-native-paper");
|
|
1450
1453
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
@@ -1461,7 +1464,7 @@ function widthForColumns(columns) {
|
|
|
1461
1464
|
return SWATCHES_BORDER_WIDTH * 2 + SWATCHES_PADDING * 2 + SWATCH_SIZE * columns + SWATCHES_GAP * (columns - 1);
|
|
1462
1465
|
}
|
|
1463
1466
|
function getInlineColorPickerContentSize(swatchCount, windowWidth, columns) {
|
|
1464
|
-
const autoColumns = (0,
|
|
1467
|
+
const autoColumns = (0, import_core11.clamp)(Math.floor((windowWidth - 2 * SCREEN_MARGIN + SWATCHES_GAP) / (SWATCH_SIZE + SWATCHES_GAP)), MIN_COLUMNS, MAX_COLUMNS);
|
|
1465
1468
|
const resolvedColumns = columns ?? autoColumns;
|
|
1466
1469
|
const width = widthForColumns(resolvedColumns);
|
|
1467
1470
|
const rows = Math.ceil(swatchCount / resolvedColumns);
|
|
@@ -1469,7 +1472,7 @@ function getInlineColorPickerContentSize(swatchCount, windowWidth, columns) {
|
|
|
1469
1472
|
return { width, height };
|
|
1470
1473
|
}
|
|
1471
1474
|
function InlineColorPicker({ id, host, value, onChange, previewValue, swatches = import_auto_paper10.defaultColors, takenValue, allowSwapTaken, dark, align: forcedAlign, alignOverride, rotation: rotationOverride, icon = "palette", tag, labelFontFamily = MONO_FONT, autoDismiss = true, columns, size = DEFAULT_SIZE }) {
|
|
1472
|
-
const ambientRotation = (0,
|
|
1475
|
+
const ambientRotation = (0, import_core11.useRotation)();
|
|
1473
1476
|
const rotation = rotationOverride ?? ambientRotation;
|
|
1474
1477
|
const menuBg = dark ? "#000000" : "#FFFFFF";
|
|
1475
1478
|
const { width: windowWidth } = (0, import_react_native23.useWindowDimensions)();
|