@tastic/hud 0.14.0 → 0.14.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/dist/index.d.mts CHANGED
@@ -78,7 +78,7 @@ interface BaseSettingsDialogProps {
78
78
  onShowHowToPlay?: () => void;
79
79
  children?: ReactNode;
80
80
  }
81
- declare function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, version, lockOrientation, onLockOrientationChange, deferBottomEdgeGestures, onDeferBottomEdgeGestures, hideSound, hideHaptics, hideAppearance, hideUpdateCheck, onUpdateError, onShowHowToPlay, children }: BaseSettingsDialogProps): react.JSX.Element;
81
+ declare function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, version, lockOrientation, onLockOrientationChange, deferBottomEdgeGestures, onDeferBottomEdgeGestures, hideSound, hideHaptics, hideAppearance, hideUpdateCheck, onUpdateError, onShowHowToPlay, children }: BaseSettingsDialogProps): react.JSX.Element | null;
82
82
 
83
83
  type MD3TextVariant = 'displayLarge' | 'displayMedium' | 'displaySmall' | 'headlineLarge' | 'headlineMedium' | 'headlineSmall' | 'titleLarge' | 'titleMedium' | 'titleSmall' | 'labelLarge' | 'labelMedium' | 'labelSmall' | 'bodyLarge' | 'bodyMedium' | 'bodySmall';
84
84
  interface Props$b {
package/dist/index.d.ts CHANGED
@@ -78,7 +78,7 @@ interface BaseSettingsDialogProps {
78
78
  onShowHowToPlay?: () => void;
79
79
  children?: ReactNode;
80
80
  }
81
- declare function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, version, lockOrientation, onLockOrientationChange, deferBottomEdgeGestures, onDeferBottomEdgeGestures, hideSound, hideHaptics, hideAppearance, hideUpdateCheck, onUpdateError, onShowHowToPlay, children }: BaseSettingsDialogProps): react.JSX.Element;
81
+ declare function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, version, lockOrientation, onLockOrientationChange, deferBottomEdgeGestures, onDeferBottomEdgeGestures, hideSound, hideHaptics, hideAppearance, hideUpdateCheck, onUpdateError, onShowHowToPlay, children }: BaseSettingsDialogProps): react.JSX.Element | null;
82
82
 
83
83
  type MD3TextVariant = 'displayLarge' | 'displayMedium' | 'displaySmall' | 'headlineLarge' | 'headlineMedium' | 'headlineSmall' | 'titleLarge' | 'titleMedium' | 'titleSmall' | 'labelLarge' | 'labelMedium' | 'labelSmall' | 'bodyLarge' | 'bodyMedium' | 'bodySmall';
84
84
  interface Props$b {
package/dist/index.js CHANGED
@@ -625,12 +625,15 @@ function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, ve
625
625
  onInfo: (title, message) => setInfoMessage({ title, message })
626
626
  });
627
627
  const updateManifestDate = updateManifest ? new Date(updateManifest.createdAt) : null;
628
+ const [opened, setOpened] = (0, import_react4.useState)(visible);
629
+ if (visible && !opened) setOpened(true);
628
630
  const showLockOrientation = isTouchPrimary && lockOrientation !== void 0 && onLockOrientationChange !== void 0;
629
631
  const showEdgeGuard = import_react_native10.Platform.OS === "ios" && deferBottomEdgeGestures !== void 0 && onDeferBottomEdgeGestures !== void 0;
630
632
  const showHaptics = import_react_native10.Platform.OS !== "web" && !hideHaptics;
631
633
  const showSound = !hideSound;
632
634
  const showAppearance = !hideAppearance;
633
635
  const showUpdateCheck = import_react_native10.Platform.OS !== "web" && !hideUpdateCheck;
636
+ if (!opened) return null;
634
637
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native_paper8.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(RotatedFrame, { rotation, rotatedSafeArea: true, portalHost: true, passThrough: true, children: [
635
638
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_auto_paper7.Dialog, { visible, onDismiss, style: styles8.dialog, children: [
636
639
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_auto_paper7.Dialog.Title, { children: "Settings" }),
package/dist/index.mjs CHANGED
@@ -346,12 +346,15 @@ function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverride, ve
346
346
  onInfo: (title, message) => setInfoMessage({ title, message })
347
347
  });
348
348
  const updateManifestDate = updateManifest ? new Date(updateManifest.createdAt) : null;
349
+ const [opened, setOpened] = useState2(visible);
350
+ if (visible && !opened) setOpened(true);
349
351
  const showLockOrientation = isTouchPrimary && lockOrientation !== void 0 && onLockOrientationChange !== void 0;
350
352
  const showEdgeGuard = Platform2.OS === "ios" && deferBottomEdgeGestures !== void 0 && onDeferBottomEdgeGestures !== void 0;
351
353
  const showHaptics = Platform2.OS !== "web" && !hideHaptics;
352
354
  const showSound = !hideSound;
353
355
  const showAppearance = !hideAppearance;
354
356
  const showUpdateCheck = Platform2.OS !== "web" && !hideUpdateCheck;
357
+ if (!opened) return null;
355
358
  return /* @__PURE__ */ jsx9(Portal3, { children: /* @__PURE__ */ jsxs8(RotatedFrame, { rotation, rotatedSafeArea: true, portalHost: true, passThrough: true, children: [
356
359
  /* @__PURE__ */ jsxs8(Dialog, { visible, onDismiss, style: styles8.dialog, children: [
357
360
  /* @__PURE__ */ jsx9(Dialog.Title, { children: "Settings" }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tastic/hud",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
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",
@@ -123,6 +123,14 @@ export function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverr
123
123
  onInfo: (title, message) => setInfoMessage({ title, message })
124
124
  })
125
125
  const updateManifestDate = updateManifest ? new Date(updateManifest.createdAt) : null
126
+ // The frame below is mounted from the first open on and then kept, so the Dialog's close fade
127
+ // still plays after `visible` turns false. Never mounting it before that keeps a screen that never
128
+ // opens Settings free of the extra (pass-through) layer, mounts the Portal at open time like the
129
+ // Dialog's own Portal always was (so it lands above portals mounted earlier), and means nothing
130
+ // here needs a Paper Portal.Host until the sheet is actually opened. The update and info cards are
131
+ // only reachable from inside the sheet, so they never need it earlier either.
132
+ const [opened, setOpened] = useState(visible)
133
+ if (visible && !opened) setOpened(true)
126
134
 
127
135
  const showLockOrientation = isTouchPrimary && lockOrientation !== undefined && onLockOrientationChange !== undefined
128
136
  const showEdgeGuard = Platform.OS === 'ios' && deferBottomEdgeGestures !== undefined && onDeferBottomEdgeGestures !== undefined
@@ -139,8 +147,9 @@ export function BaseSettingsDialog({ visible, onDismiss, rotation: rotationOverr
139
147
  // to the turned footprint, with rotated safe-area insets and its own Portal.Host. The Dialog and the
140
148
  // two ConfirmDialogs below portal into THAT host, so they lay out against the turned window with no
141
149
  // transform of their own (hence rotation={0} on the ConfirmDialogs). The frame is pass-through at
142
- // every level and stays mounted with this component, which keeps the Dialog's close fade; at
150
+ // every level and stays mounted once the sheet has opened, which keeps the Dialog's close fade; at
143
151
  // rotation 0 it is an identity frame.
152
+ if (!opened) return null
144
153
  return (
145
154
  <Portal>
146
155
  <RotatedFrame rotation={rotation} rotatedSafeArea portalHost passThrough>