@joewinke/jatui 0.31.1 → 0.31.2

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.
@@ -71,7 +71,7 @@
71
71
  const p = player ?? getSoundPlayer();
72
72
  // A preview click is a real gesture: unlock here too, so a first-ever
73
73
  // preview on iOS actually sounds instead of resuming a dead context.
74
- void p.unlock();
74
+ void p.unlock?.();
75
75
  previewing = p.play(name, { preview: true, loop: false });
76
76
  previewTimer = setTimeout(stopPreview, PREVIEW_MAX_MS);
77
77
  }
@@ -53,15 +53,17 @@ export interface SoundPlayer {
53
53
  /**
54
54
  * Unlock audio output from inside a user-gesture handler (iOS/Safari
55
55
  * keeps a context suspended unless the gesture created/resumed it —
56
- * see `sound/unlock.ts`). Backends without an unlock concept resolve
57
- * immediately. A cheap no-op once unlocked.
56
+ * see `sound/unlock.ts`). OPTIONAL: a custom player without one is
57
+ * assumed fine — unlock resolves and `unlocked` reads undefined, which
58
+ * hosts treat as "no unlock concept". A cheap no-op once unlocked.
58
59
  */
59
- unlock(): Promise<void>;
60
+ unlock?(): Promise<void>;
60
61
  /**
61
- * True when the backend reports a running output context; a backend
62
- * with no unlock concept always reports true. False before any unlock.
62
+ * True when the player's backend reports a running output context;
63
+ * false before any unlock, undefined when the player has no unlock
64
+ * concept.
63
65
  */
64
- readonly unlocked: boolean;
66
+ readonly unlocked?: boolean;
65
67
  /** Decode clips ahead of time (defaults to every semantic name). */
66
68
  preload(names?: readonly SoundId[]): Promise<void>;
67
69
  stopAll(): void;
@@ -30,7 +30,7 @@ import { getSoundPlayer } from './player';
30
30
  * is a cheap no-op once the context is running.
31
31
  */
32
32
  export async function unlockSound() {
33
- await getSoundPlayer().unlock();
33
+ await getSoundPlayer().unlock?.();
34
34
  }
35
35
  const GESTURES = ['pointerup', 'touchend', 'click', 'keydown'];
36
36
  /** The target `armSoundUnlock` installed its one-shot listener on, if any. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joewinke/jatui",
3
- "version": "0.31.1",
3
+ "version": "0.31.2",
4
4
  "private": false,
5
5
  "description": "Shared Svelte 5 component library for JAT projects",
6
6
  "type": "module",