@tastic/hud 0.28.0 → 0.29.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/dist/chrome/index.d.mts +2 -1
- package/dist/chrome/index.d.ts +2 -1
- package/dist/chrome/index.js +8 -1
- package/dist/chrome/index.mjs +1 -1
- package/dist/{chunk-75Q2VN5R.mjs → chunk-ACY6UK4V.mjs} +8 -1
- package/dist/index.js +8 -1
- package/dist/index.mjs +5 -5
- package/package.json +7 -7
- package/src/BaseSettingsDialog.tsx +20 -1
package/dist/chrome/index.d.mts
CHANGED
|
@@ -62,8 +62,9 @@ interface BaseSettingsDialogProps {
|
|
|
62
62
|
onUpdateError?: (message: string) => void;
|
|
63
63
|
onShowHowToPlay?: () => void;
|
|
64
64
|
children?: ReactNode;
|
|
65
|
+
leading?: ReactNode;
|
|
65
66
|
}
|
|
66
|
-
declare function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, version, lockOrientation, onLockOrientationChange, deferBottomEdgeGestures, onDeferBottomEdgeGestures, hideSound, hideHaptics, hideAppearance, hideUpdateCheck, onUpdateError, onShowHowToPlay, children }: BaseSettingsDialogProps): react.JSX.Element | null;
|
|
67
|
+
declare function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, version, lockOrientation, onLockOrientationChange, deferBottomEdgeGestures, onDeferBottomEdgeGestures, hideSound, hideHaptics, hideAppearance, hideUpdateCheck, onUpdateError, onShowHowToPlay, children, leading }: BaseSettingsDialogProps): react.JSX.Element | null;
|
|
67
68
|
|
|
68
69
|
type MD3TextVariant = 'displayLarge' | 'displayMedium' | 'displaySmall' | 'headlineLarge' | 'headlineMedium' | 'headlineSmall' | 'titleLarge' | 'titleMedium' | 'titleSmall' | 'labelLarge' | 'labelMedium' | 'labelSmall' | 'bodyLarge' | 'bodyMedium' | 'bodySmall';
|
|
69
70
|
interface Props$7 {
|
package/dist/chrome/index.d.ts
CHANGED
|
@@ -62,8 +62,9 @@ interface BaseSettingsDialogProps {
|
|
|
62
62
|
onUpdateError?: (message: string) => void;
|
|
63
63
|
onShowHowToPlay?: () => void;
|
|
64
64
|
children?: ReactNode;
|
|
65
|
+
leading?: ReactNode;
|
|
65
66
|
}
|
|
66
|
-
declare function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, version, lockOrientation, onLockOrientationChange, deferBottomEdgeGestures, onDeferBottomEdgeGestures, hideSound, hideHaptics, hideAppearance, hideUpdateCheck, onUpdateError, onShowHowToPlay, children }: BaseSettingsDialogProps): react.JSX.Element | null;
|
|
67
|
+
declare function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, version, lockOrientation, onLockOrientationChange, deferBottomEdgeGestures, onDeferBottomEdgeGestures, hideSound, hideHaptics, hideAppearance, hideUpdateCheck, onUpdateError, onShowHowToPlay, children, leading }: BaseSettingsDialogProps): react.JSX.Element | null;
|
|
67
68
|
|
|
68
69
|
type MD3TextVariant = 'displayLarge' | 'displayMedium' | 'displaySmall' | 'headlineLarge' | 'headlineMedium' | 'headlineSmall' | 'titleLarge' | 'titleMedium' | 'titleSmall' | 'labelLarge' | 'labelMedium' | 'labelSmall' | 'bodyLarge' | 'bodyMedium' | 'bodySmall';
|
|
69
70
|
interface Props$7 {
|
package/dist/chrome/index.js
CHANGED
|
@@ -515,7 +515,7 @@ var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
|
515
515
|
function SettingIcon({ source, color, containerColor }) {
|
|
516
516
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native12.View, { style: [styles9.iconBadge, { backgroundColor: containerColor }], children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native_paper8.Icon, { source, size: 18, color }) });
|
|
517
517
|
}
|
|
518
|
-
function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, version, lockOrientation, onLockOrientationChange, deferBottomEdgeGestures, onDeferBottomEdgeGestures, hideSound = false, hideHaptics = false, hideAppearance = false, hideUpdateCheck = false, onUpdateError, onShowHowToPlay, children }) {
|
|
518
|
+
function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, version, lockOrientation, onLockOrientationChange, deferBottomEdgeGestures, onDeferBottomEdgeGestures, hideSound = false, hideHaptics = false, hideAppearance = false, hideUpdateCheck = false, onUpdateError, onShowHowToPlay, children, leading }) {
|
|
519
519
|
const { colors } = (0, import_auto_paper6.useAutoPaperTheme)();
|
|
520
520
|
const ambientRotation = (0, import_core5.useRotation)();
|
|
521
521
|
const rotation = rotationOverride ?? ambientRotation;
|
|
@@ -553,13 +553,16 @@ function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, ve
|
|
|
553
553
|
const showAppearance = !hideAppearance;
|
|
554
554
|
const showBlur = showAppearance && import_react_native12.Platform.OS !== "android" && expoBlur !== void 0 && expoBlur !== null;
|
|
555
555
|
const showUpdateCheck = import_react_native12.Platform.OS !== "web" && !hideUpdateCheck;
|
|
556
|
+
const hasLeading = leading !== void 0 && leading !== null && leading !== false;
|
|
556
557
|
if (!opened) return null;
|
|
557
558
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native_paper8.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(RotatedFrame, { rotation, rotatedSafeArea: true, portalHost: true, passThrough: true, children: [
|
|
558
559
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_auto_paper6.Dialog, { visible, onDismiss, style: [styles9.dialog, { width: sheetWidth }], children: [
|
|
559
560
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_auto_paper6.Dialog.ScrollArea, { style: styles9.scrollArea, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_auto_paper6.FadingScrollView, { contentContainerStyle: styles9.scrollContent, showsVerticalScrollIndicator: false, children: [
|
|
560
561
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DialogHeader, { icon: "cog", title: "Settings", compact: compactHeader }),
|
|
561
562
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native12.View, { style: styles9.content, children: [
|
|
563
|
+
hasLeading && leading,
|
|
562
564
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native12.View, { style: styles9.toggleGroup, children: [
|
|
565
|
+
hasLeading && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native_paper8.Text, { variant: "labelMedium", style: [styles9.sectionLabel, styles9.toggleGroupLabel, { color: colors.onSurfaceVariant }], children: "GENERAL" }),
|
|
563
566
|
showLockOrientation && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_feedback_press3.TouchableRipple, { onPress: () => onLockOrientationChange(!lockOrientation), style: styles9.toggleButton, accessibilityLabel: `Lock orientation ${lockOrientation ? "on" : "off"}`, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native12.View, { style: styles9.toggleContent, children: [
|
|
564
567
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SettingIcon, { source: lockOrientation ? "lock" : "lock-open-variant-outline", color: lockOrientation ? colors.tertiary : colors.onSurfaceVariant, containerColor: lockOrientation ? colors.tertiaryContainer : colors.surfaceVariant }),
|
|
565
568
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native12.View, { style: styles9.flexShrink, children: [
|
|
@@ -741,6 +744,10 @@ var styles9 = import_react_native12.StyleSheet.create({
|
|
|
741
744
|
toggleGroup: {
|
|
742
745
|
gap: 4
|
|
743
746
|
},
|
|
747
|
+
// The 12pt a section's label sits above its rows (styles.section), less the group's own 4pt gap.
|
|
748
|
+
toggleGroupLabel: {
|
|
749
|
+
marginBottom: 8
|
|
750
|
+
},
|
|
744
751
|
// No horizontal margin of its own now either - see toggleButton's identical note.
|
|
745
752
|
toggleRow: {
|
|
746
753
|
flexDirection: "row",
|
package/dist/chrome/index.mjs
CHANGED
|
@@ -315,7 +315,7 @@ import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
|
315
315
|
function SettingIcon({ source, color, containerColor }) {
|
|
316
316
|
return /* @__PURE__ */ jsx8(View6, { style: [styles7.iconBadge, { backgroundColor: containerColor }], children: /* @__PURE__ */ jsx8(Icon2, { source, size: 18, color }) });
|
|
317
317
|
}
|
|
318
|
-
function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, version, lockOrientation, onLockOrientationChange, deferBottomEdgeGestures, onDeferBottomEdgeGestures, hideSound = false, hideHaptics = false, hideAppearance = false, hideUpdateCheck = false, onUpdateError, onShowHowToPlay, children }) {
|
|
318
|
+
function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, version, lockOrientation, onLockOrientationChange, deferBottomEdgeGestures, onDeferBottomEdgeGestures, hideSound = false, hideHaptics = false, hideAppearance = false, hideUpdateCheck = false, onUpdateError, onShowHowToPlay, children, leading }) {
|
|
319
319
|
const { colors } = useAutoPaperTheme4();
|
|
320
320
|
const ambientRotation = useRotation2();
|
|
321
321
|
const rotation = rotationOverride ?? ambientRotation;
|
|
@@ -353,13 +353,16 @@ function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, ve
|
|
|
353
353
|
const showAppearance = !hideAppearance;
|
|
354
354
|
const showBlur = showAppearance && Platform.OS !== "android" && expoBlur !== void 0 && expoBlur !== null;
|
|
355
355
|
const showUpdateCheck = Platform.OS !== "web" && !hideUpdateCheck;
|
|
356
|
+
const hasLeading = leading !== void 0 && leading !== null && leading !== false;
|
|
356
357
|
if (!opened) return null;
|
|
357
358
|
return /* @__PURE__ */ jsx8(Portal3, { children: /* @__PURE__ */ jsxs7(RotatedFrame, { rotation, rotatedSafeArea: true, portalHost: true, passThrough: true, children: [
|
|
358
359
|
/* @__PURE__ */ jsxs7(Dialog, { visible, onDismiss, style: [styles7.dialog, { width: sheetWidth }], children: [
|
|
359
360
|
/* @__PURE__ */ jsx8(Dialog.ScrollArea, { style: styles7.scrollArea, children: /* @__PURE__ */ jsxs7(FadingScrollView, { contentContainerStyle: styles7.scrollContent, showsVerticalScrollIndicator: false, children: [
|
|
360
361
|
/* @__PURE__ */ jsx8(DialogHeader, { icon: "cog", title: "Settings", compact: compactHeader }),
|
|
361
362
|
/* @__PURE__ */ jsxs7(View6, { style: styles7.content, children: [
|
|
363
|
+
hasLeading && leading,
|
|
362
364
|
/* @__PURE__ */ jsxs7(View6, { style: styles7.toggleGroup, children: [
|
|
365
|
+
hasLeading && /* @__PURE__ */ jsx8(Text6, { variant: "labelMedium", style: [styles7.sectionLabel, styles7.toggleGroupLabel, { color: colors.onSurfaceVariant }], children: "GENERAL" }),
|
|
363
366
|
showLockOrientation && /* @__PURE__ */ jsx8(TouchableRipple, { onPress: () => onLockOrientationChange(!lockOrientation), style: styles7.toggleButton, accessibilityLabel: `Lock orientation ${lockOrientation ? "on" : "off"}`, children: /* @__PURE__ */ jsxs7(View6, { style: styles7.toggleContent, children: [
|
|
364
367
|
/* @__PURE__ */ jsx8(SettingIcon, { source: lockOrientation ? "lock" : "lock-open-variant-outline", color: lockOrientation ? colors.tertiary : colors.onSurfaceVariant, containerColor: lockOrientation ? colors.tertiaryContainer : colors.surfaceVariant }),
|
|
365
368
|
/* @__PURE__ */ jsxs7(View6, { style: styles7.flexShrink, children: [
|
|
@@ -541,6 +544,10 @@ var styles7 = StyleSheet7.create({
|
|
|
541
544
|
toggleGroup: {
|
|
542
545
|
gap: 4
|
|
543
546
|
},
|
|
547
|
+
// The 12pt a section's label sits above its rows (styles.section), less the group's own 4pt gap.
|
|
548
|
+
toggleGroupLabel: {
|
|
549
|
+
marginBottom: 8
|
|
550
|
+
},
|
|
544
551
|
// No horizontal margin of its own now either - see toggleButton's identical note.
|
|
545
552
|
toggleRow: {
|
|
546
553
|
flexDirection: "row",
|
package/dist/index.js
CHANGED
|
@@ -714,7 +714,7 @@ var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
|
714
714
|
function SettingIcon({ source, color, containerColor }) {
|
|
715
715
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native13.View, { style: [styles10.iconBadge, { backgroundColor: containerColor }], children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native_paper9.Icon, { source, size: 18, color }) });
|
|
716
716
|
}
|
|
717
|
-
function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, version, lockOrientation, onLockOrientationChange, deferBottomEdgeGestures, onDeferBottomEdgeGestures, hideSound = false, hideHaptics = false, hideAppearance = false, hideUpdateCheck = false, onUpdateError, onShowHowToPlay, children }) {
|
|
717
|
+
function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, version, lockOrientation, onLockOrientationChange, deferBottomEdgeGestures, onDeferBottomEdgeGestures, hideSound = false, hideHaptics = false, hideAppearance = false, hideUpdateCheck = false, onUpdateError, onShowHowToPlay, children, leading }) {
|
|
718
718
|
const { colors } = (0, import_auto_paper7.useAutoPaperTheme)();
|
|
719
719
|
const ambientRotation = (0, import_core5.useRotation)();
|
|
720
720
|
const rotation = rotationOverride ?? ambientRotation;
|
|
@@ -752,13 +752,16 @@ function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, ve
|
|
|
752
752
|
const showAppearance = !hideAppearance;
|
|
753
753
|
const showBlur = showAppearance && import_react_native13.Platform.OS !== "android" && expoBlur !== void 0 && expoBlur !== null;
|
|
754
754
|
const showUpdateCheck = import_react_native13.Platform.OS !== "web" && !hideUpdateCheck;
|
|
755
|
+
const hasLeading = leading !== void 0 && leading !== null && leading !== false;
|
|
755
756
|
if (!opened) return null;
|
|
756
757
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native_paper9.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(RotatedFrame, { rotation, rotatedSafeArea: true, portalHost: true, passThrough: true, children: [
|
|
757
758
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_auto_paper7.Dialog, { visible, onDismiss, style: [styles10.dialog, { width: sheetWidth }], children: [
|
|
758
759
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_auto_paper7.Dialog.ScrollArea, { style: styles10.scrollArea, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_auto_paper7.FadingScrollView, { contentContainerStyle: styles10.scrollContent, showsVerticalScrollIndicator: false, children: [
|
|
759
760
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DialogHeader, { icon: "cog", title: "Settings", compact: compactHeader }),
|
|
760
761
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native13.View, { style: styles10.content, children: [
|
|
762
|
+
hasLeading && leading,
|
|
761
763
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native13.View, { style: styles10.toggleGroup, children: [
|
|
764
|
+
hasLeading && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native_paper9.Text, { variant: "labelMedium", style: [styles10.sectionLabel, styles10.toggleGroupLabel, { color: colors.onSurfaceVariant }], children: "GENERAL" }),
|
|
762
765
|
showLockOrientation && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_feedback_press3.TouchableRipple, { onPress: () => onLockOrientationChange(!lockOrientation), style: styles10.toggleButton, accessibilityLabel: `Lock orientation ${lockOrientation ? "on" : "off"}`, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native13.View, { style: styles10.toggleContent, children: [
|
|
763
766
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SettingIcon, { source: lockOrientation ? "lock" : "lock-open-variant-outline", color: lockOrientation ? colors.tertiary : colors.onSurfaceVariant, containerColor: lockOrientation ? colors.tertiaryContainer : colors.surfaceVariant }),
|
|
764
767
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native13.View, { style: styles10.flexShrink, children: [
|
|
@@ -940,6 +943,10 @@ var styles10 = import_react_native13.StyleSheet.create({
|
|
|
940
943
|
toggleGroup: {
|
|
941
944
|
gap: 4
|
|
942
945
|
},
|
|
946
|
+
// The 12pt a section's label sits above its rows (styles.section), less the group's own 4pt gap.
|
|
947
|
+
toggleGroupLabel: {
|
|
948
|
+
marginBottom: 8
|
|
949
|
+
},
|
|
943
950
|
// No horizontal margin of its own now either - see toggleButton's identical note.
|
|
944
951
|
toggleRow: {
|
|
945
952
|
flexDirection: "row",
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
loadSkiaWeb,
|
|
3
|
+
locateSkiaWebFile
|
|
4
|
+
} from "./chunk-3TCJHMJP.mjs";
|
|
1
5
|
import {
|
|
2
6
|
AchievementCatalogSection,
|
|
3
7
|
AchievementRow,
|
|
@@ -18,7 +22,7 @@ import {
|
|
|
18
22
|
getStaggeredWordDuration,
|
|
19
23
|
useCompactDialog,
|
|
20
24
|
useWellColors
|
|
21
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-ACY6UK4V.mjs";
|
|
22
26
|
import {
|
|
23
27
|
COMPACT_DIALOG_HEIGHT,
|
|
24
28
|
DialogHeader,
|
|
@@ -47,10 +51,6 @@ import {
|
|
|
47
51
|
useAutoAlign,
|
|
48
52
|
usePopoverHost
|
|
49
53
|
} from "./chunk-5ECU3722.mjs";
|
|
50
|
-
import {
|
|
51
|
-
loadSkiaWeb,
|
|
52
|
-
locateSkiaWebFile
|
|
53
|
-
} from "./chunk-3TCJHMJP.mjs";
|
|
54
54
|
|
|
55
55
|
// src/AchievementUnlockList.tsx
|
|
56
56
|
import { getContrastColor, useAutoPaperTheme } from "@rific/auto-paper";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tastic/hud",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"description": "Visual component kit for local-multiplayer React Native games: inline (non-modal) popovers, dropdowns, color pickers, gauges, ready buttons, and dialogs, built to stay scoped to one player's own zone on a shared screen",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -93,15 +93,15 @@
|
|
|
93
93
|
"devDependencies": {
|
|
94
94
|
"@infinitetoken/eslint-config": "^0.2.1",
|
|
95
95
|
"@infinitetoken/jest-config": "^0.5.2",
|
|
96
|
-
"@infinitetoken/tsconfig": "^0.
|
|
97
|
-
"@rific/auto-paper": "^0.
|
|
96
|
+
"@infinitetoken/tsconfig": "^0.7.0",
|
|
97
|
+
"@rific/auto-paper": "^0.14.0",
|
|
98
98
|
"@rific/core": "^0.5.0",
|
|
99
99
|
"@rific/feedback-press": "^0.13.1",
|
|
100
|
-
"@rific/updater": "^0.
|
|
100
|
+
"@rific/updater": "^0.8.0",
|
|
101
101
|
"@shopify/react-native-skia": "^2.14.0",
|
|
102
102
|
"@tastic/achievements": "^0.6.0",
|
|
103
|
-
"@tastic/core": "^0.
|
|
104
|
-
"@tastic/profile": "^0.
|
|
103
|
+
"@tastic/core": "^0.16.0",
|
|
104
|
+
"@tastic/profile": "^0.18.0",
|
|
105
105
|
"@tastic/split-screen": "^0.5.5",
|
|
106
106
|
"@testing-library/dom": "^10.4.1",
|
|
107
107
|
"@testing-library/react": "^16.3.2",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"typescript": "^6.0.3"
|
|
124
124
|
},
|
|
125
125
|
"peerDependencies": {
|
|
126
|
-
"@rific/auto-paper": "
|
|
126
|
+
"@rific/auto-paper": ">=0.13.0",
|
|
127
127
|
"@rific/core": ">=0.4.0",
|
|
128
128
|
"@rific/feedback-press": ">=0.10.2",
|
|
129
129
|
"@rific/updater": ">=0.4.0",
|
|
@@ -83,6 +83,12 @@ export interface BaseSettingsDialogProps {
|
|
|
83
83
|
// rendered between Appearance and Check for Updates - this component only owns the settings
|
|
84
84
|
// every game shares, never anything about how a particular game plays.
|
|
85
85
|
children?: ReactNode
|
|
86
|
+
// App-specific sections shown FIRST, above every shared row: a game's own rules, which someone
|
|
87
|
+
// opening Settings from that game is most likely there for (Solitaire, Jay 2026-11-10: rules below
|
|
88
|
+
// Sound, How to Play and Appearance went unfound). When given, the shared rows get a GENERAL
|
|
89
|
+
// label, so every gap between sections is still followed by a label. Omit it (or pass null) where
|
|
90
|
+
// there is nothing to put first: the sheet is then exactly as before.
|
|
91
|
+
leading?: ReactNode
|
|
86
92
|
}
|
|
87
93
|
|
|
88
94
|
// The settings shell every @tastic game shares - orientation lock, the optional edge-guard and
|
|
@@ -92,7 +98,7 @@ export interface BaseSettingsDialogProps {
|
|
|
92
98
|
// is the seam for whatever isn't shared: a game with its own board/difficulty settings (or a stats
|
|
93
99
|
// backup flow, or anything else genuinely specific to it) renders those below Appearance, not by
|
|
94
100
|
// forking this component.
|
|
95
|
-
export function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, version, lockOrientation, onLockOrientationChange, deferBottomEdgeGestures, onDeferBottomEdgeGestures, hideSound = false, hideHaptics = false, hideAppearance = false, hideUpdateCheck = false, onUpdateError, onShowHowToPlay, children }: BaseSettingsDialogProps) {
|
|
101
|
+
export function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, version, lockOrientation, onLockOrientationChange, deferBottomEdgeGestures, onDeferBottomEdgeGestures, hideSound = false, hideHaptics = false, hideAppearance = false, hideUpdateCheck = false, onUpdateError, onShowHowToPlay, children, leading }: BaseSettingsDialogProps) {
|
|
96
102
|
const { colors } = useAutoPaperTheme()
|
|
97
103
|
const ambientRotation = useRotation()
|
|
98
104
|
const rotation = rotationOverride ?? ambientRotation
|
|
@@ -169,6 +175,7 @@ export function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverr
|
|
|
169
175
|
// See the Blur row's own comment below for why it hides on Android and without expo-blur.
|
|
170
176
|
const showBlur = showAppearance && Platform.OS !== 'android' && expoBlur !== undefined && expoBlur !== null
|
|
171
177
|
const showUpdateCheck = Platform.OS !== 'web' && !hideUpdateCheck
|
|
178
|
+
const hasLeading = leading !== undefined && leading !== null && leading !== false
|
|
172
179
|
|
|
173
180
|
// Laid out in its own turned frame rather than rotated in place. Paper's Portal mounts at the app
|
|
174
181
|
// root, full screen and portrait-shaped, so a sheet that only rotated its card kept resolving its
|
|
@@ -197,11 +204,19 @@ export function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverr
|
|
|
197
204
|
closes it too. */}
|
|
198
205
|
<DialogHeader icon='cog' title='Settings' compact={compactHeader} />
|
|
199
206
|
<View style={styles.content}>
|
|
207
|
+
{hasLeading && leading}
|
|
200
208
|
{/* Grouped tightly together (styles.toggleGroup's small internal gap, not the 24px gap
|
|
201
209
|
between sections below) - same bare-row shape for all of them, no segmented control
|
|
202
210
|
and no section heading (each row's own label already says what it is). Haptics only
|
|
203
211
|
joins on native - there's nothing for it to control on web. */}
|
|
204
212
|
<View style={styles.toggleGroup}>
|
|
213
|
+
{/* Unlabeled while it opens the sheet (each row's own label says what it is); labeled
|
|
214
|
+
once an app's leading sections sit above it, like every other section after a gap. */}
|
|
215
|
+
{hasLeading && (
|
|
216
|
+
<Text variant='labelMedium' style={[styles.sectionLabel, styles.toggleGroupLabel, { color: colors.onSurfaceVariant }]}>
|
|
217
|
+
GENERAL
|
|
218
|
+
</Text>
|
|
219
|
+
)}
|
|
205
220
|
{/* Omitted entirely for a portrait-only game (no lockOrientation/onLockOrientationChange
|
|
206
221
|
passed at all - nothing to lock), and hidden (not just disabled) on a desktop/laptop
|
|
207
222
|
browser even when they are - see isTouchPrimary's own doc above. Still shown on
|
|
@@ -489,6 +504,10 @@ const styles = StyleSheet.create({
|
|
|
489
504
|
toggleGroup: {
|
|
490
505
|
gap: 4
|
|
491
506
|
},
|
|
507
|
+
// The 12pt a section's label sits above its rows (styles.section), less the group's own 4pt gap.
|
|
508
|
+
toggleGroupLabel: {
|
|
509
|
+
marginBottom: 8
|
|
510
|
+
},
|
|
492
511
|
// No horizontal margin of its own now either - see toggleButton's identical note.
|
|
493
512
|
toggleRow: {
|
|
494
513
|
flexDirection: 'row',
|