@air-jam/sdk 0.1.2 → 0.1.4
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.cjs +1631 -1770
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -41
- package/dist/index.d.ts +6 -41
- package/dist/index.js +1633 -1769
- package/dist/index.js.map +1 -1
- package/package.json +10 -7
- package/src/components/controller-shell.tsx +94 -69
- package/src/components/{air-jam-overlay.tsx → host-shell.tsx} +57 -50
- package/src/components/player-avatar.tsx +0 -1
- package/src/context/air-jam-context.tsx +21 -1
- package/src/context/socket-manager.ts +0 -1
- package/src/index.ts +1 -3
- package/src/components/air-jam-debug.tsx +0 -77
- package/src/components/debug-state-dialog.tsx +0 -83
package/dist/index.d.cts
CHANGED
|
@@ -590,54 +590,19 @@ interface VolumeSettings {
|
|
|
590
590
|
}
|
|
591
591
|
declare const useVolumeStore: zustand.UseBoundStore<zustand.StoreApi<VolumeSettings>>;
|
|
592
592
|
|
|
593
|
-
interface AirJamDebugProps {
|
|
594
|
-
state: unknown;
|
|
595
|
-
title?: string;
|
|
596
|
-
updateInterval?: number;
|
|
597
|
-
className?: string;
|
|
598
|
-
}
|
|
599
|
-
/**
|
|
600
|
-
* A debug component that displays state in a dialog.
|
|
601
|
-
* Place this component anywhere in your React tree and pass the state you want to debug.
|
|
602
|
-
*
|
|
603
|
-
* @example
|
|
604
|
-
* ```tsx
|
|
605
|
-
* const { phase, scores } = useGameStore((state) => state);
|
|
606
|
-
*
|
|
607
|
-
* return (
|
|
608
|
-
* <div>
|
|
609
|
-
* <AirJamDebug state={{ phase, scores }} />
|
|
610
|
-
* {/* Your game UI *\/}
|
|
611
|
-
* </div>
|
|
612
|
-
* );
|
|
613
|
-
* ```
|
|
614
|
-
*/
|
|
615
|
-
declare const AirJamDebug: ({ state, title, updateInterval, className, }: AirJamDebugProps) => JSX.Element;
|
|
616
|
-
|
|
617
|
-
declare const AirJamOverlay: () => JSX.Element | null;
|
|
618
|
-
|
|
619
593
|
interface ControllerShellProps {
|
|
620
|
-
roomId?: string | null;
|
|
621
|
-
connectionStatus: ConnectionStatus;
|
|
622
594
|
/** Optional forced orientation. If not set, no orientation enforcement is applied. */
|
|
623
595
|
forceOrientation?: "portrait" | "landscape";
|
|
624
596
|
children: ReactNode;
|
|
625
|
-
|
|
626
|
-
onTogglePlayPause?: () => void;
|
|
627
|
-
onReconnect?: (roomCode: string) => void;
|
|
628
|
-
onRefresh?: () => void;
|
|
597
|
+
/** Optional custom actions to display in the header */
|
|
629
598
|
customActions?: ReactNode;
|
|
630
599
|
}
|
|
631
|
-
declare const ControllerShell: ({
|
|
600
|
+
declare const ControllerShell: ({ forceOrientation, children, customActions, }: ControllerShellProps) => JSX.Element;
|
|
632
601
|
|
|
633
|
-
interface
|
|
634
|
-
|
|
635
|
-
onClose: () => void;
|
|
636
|
-
getState: () => unknown;
|
|
637
|
-
title?: string;
|
|
638
|
-
updateInterval?: number;
|
|
602
|
+
interface HostShellProps {
|
|
603
|
+
children: ReactNode;
|
|
639
604
|
}
|
|
640
|
-
declare const
|
|
605
|
+
declare const HostShell: ({ children }: HostShellProps) => JSX.Element;
|
|
641
606
|
|
|
642
607
|
interface PlayerAvatarProps {
|
|
643
608
|
player: PlayerProfile;
|
|
@@ -1582,4 +1547,4 @@ declare class UrlBuilder {
|
|
|
1582
1547
|
}
|
|
1583
1548
|
declare const urlBuilder: UrlBuilder;
|
|
1584
1549
|
|
|
1585
|
-
export { type AirJamConfig, AirJamContext, type AirJamContextValue, type AirJamControllerApi, type AirJamControllerOptions,
|
|
1550
|
+
export { type AirJamConfig, AirJamContext, type AirJamContextValue, type AirJamControllerApi, type AirJamControllerOptions, type AirJamHostApi, type AirJamHostOptions, AirJamProvider, type AirJamProviderProps, type AirJamShellApi, type AirJamSocket, AudioManager, AudioProvider, Button, CONTROLLER_PATH, ChildEvents, ClientEvents, ClientToServerEvents, ConnectionRole, ConnectionStatus, ControllerEvents, ControllerInputEvent, ControllerInputPayload, ControllerShell, ControllerStatePayload, DEFAULT_MAX_PLAYERS, DEFAULT_SERVER_PORT, Events, GameState, HapticSignalPayload, HostEvents, HostShell, INPUT_DEBOUNCE_MS, type PlayOptions, PlayerAvatar, PlayerProfile, RoomCode, RunMode, SOCKET_CONFIG, type SendSignalFn, ServerEvents, ServerToClientEvents, Slider, SocketManager, type SoundCategory, type SoundConfig, type SoundManifest, SystemEvents, TOGGLE_DEBOUNCE_MS, ToastSignalPayload, UrlBuilder, VolumeControls, buttonVariants, createAirJamStore, createAudioManager, detectSoundCategory, generateControllerId, generateRoomCode, getLocalNetworkIp, urlBuilder, useAirJamConfig, useAirJamContext, useAirJamController, useAirJamHost, useAirJamShell, useAirJamSocket, useAirJamState, useAudio, useAudioLegacy, useAudioManager, useGetInput, useSendSignal, useVolumeStore };
|
package/dist/index.d.ts
CHANGED
|
@@ -590,54 +590,19 @@ interface VolumeSettings {
|
|
|
590
590
|
}
|
|
591
591
|
declare const useVolumeStore: zustand.UseBoundStore<zustand.StoreApi<VolumeSettings>>;
|
|
592
592
|
|
|
593
|
-
interface AirJamDebugProps {
|
|
594
|
-
state: unknown;
|
|
595
|
-
title?: string;
|
|
596
|
-
updateInterval?: number;
|
|
597
|
-
className?: string;
|
|
598
|
-
}
|
|
599
|
-
/**
|
|
600
|
-
* A debug component that displays state in a dialog.
|
|
601
|
-
* Place this component anywhere in your React tree and pass the state you want to debug.
|
|
602
|
-
*
|
|
603
|
-
* @example
|
|
604
|
-
* ```tsx
|
|
605
|
-
* const { phase, scores } = useGameStore((state) => state);
|
|
606
|
-
*
|
|
607
|
-
* return (
|
|
608
|
-
* <div>
|
|
609
|
-
* <AirJamDebug state={{ phase, scores }} />
|
|
610
|
-
* {/* Your game UI *\/}
|
|
611
|
-
* </div>
|
|
612
|
-
* );
|
|
613
|
-
* ```
|
|
614
|
-
*/
|
|
615
|
-
declare const AirJamDebug: ({ state, title, updateInterval, className, }: AirJamDebugProps) => JSX.Element;
|
|
616
|
-
|
|
617
|
-
declare const AirJamOverlay: () => JSX.Element | null;
|
|
618
|
-
|
|
619
593
|
interface ControllerShellProps {
|
|
620
|
-
roomId?: string | null;
|
|
621
|
-
connectionStatus: ConnectionStatus;
|
|
622
594
|
/** Optional forced orientation. If not set, no orientation enforcement is applied. */
|
|
623
595
|
forceOrientation?: "portrait" | "landscape";
|
|
624
596
|
children: ReactNode;
|
|
625
|
-
|
|
626
|
-
onTogglePlayPause?: () => void;
|
|
627
|
-
onReconnect?: (roomCode: string) => void;
|
|
628
|
-
onRefresh?: () => void;
|
|
597
|
+
/** Optional custom actions to display in the header */
|
|
629
598
|
customActions?: ReactNode;
|
|
630
599
|
}
|
|
631
|
-
declare const ControllerShell: ({
|
|
600
|
+
declare const ControllerShell: ({ forceOrientation, children, customActions, }: ControllerShellProps) => JSX.Element;
|
|
632
601
|
|
|
633
|
-
interface
|
|
634
|
-
|
|
635
|
-
onClose: () => void;
|
|
636
|
-
getState: () => unknown;
|
|
637
|
-
title?: string;
|
|
638
|
-
updateInterval?: number;
|
|
602
|
+
interface HostShellProps {
|
|
603
|
+
children: ReactNode;
|
|
639
604
|
}
|
|
640
|
-
declare const
|
|
605
|
+
declare const HostShell: ({ children }: HostShellProps) => JSX.Element;
|
|
641
606
|
|
|
642
607
|
interface PlayerAvatarProps {
|
|
643
608
|
player: PlayerProfile;
|
|
@@ -1582,4 +1547,4 @@ declare class UrlBuilder {
|
|
|
1582
1547
|
}
|
|
1583
1548
|
declare const urlBuilder: UrlBuilder;
|
|
1584
1549
|
|
|
1585
|
-
export { type AirJamConfig, AirJamContext, type AirJamContextValue, type AirJamControllerApi, type AirJamControllerOptions,
|
|
1550
|
+
export { type AirJamConfig, AirJamContext, type AirJamContextValue, type AirJamControllerApi, type AirJamControllerOptions, type AirJamHostApi, type AirJamHostOptions, AirJamProvider, type AirJamProviderProps, type AirJamShellApi, type AirJamSocket, AudioManager, AudioProvider, Button, CONTROLLER_PATH, ChildEvents, ClientEvents, ClientToServerEvents, ConnectionRole, ConnectionStatus, ControllerEvents, ControllerInputEvent, ControllerInputPayload, ControllerShell, ControllerStatePayload, DEFAULT_MAX_PLAYERS, DEFAULT_SERVER_PORT, Events, GameState, HapticSignalPayload, HostEvents, HostShell, INPUT_DEBOUNCE_MS, type PlayOptions, PlayerAvatar, PlayerProfile, RoomCode, RunMode, SOCKET_CONFIG, type SendSignalFn, ServerEvents, ServerToClientEvents, Slider, SocketManager, type SoundCategory, type SoundConfig, type SoundManifest, SystemEvents, TOGGLE_DEBOUNCE_MS, ToastSignalPayload, UrlBuilder, VolumeControls, buttonVariants, createAirJamStore, createAudioManager, detectSoundCategory, generateControllerId, generateRoomCode, getLocalNetworkIp, urlBuilder, useAirJamConfig, useAirJamContext, useAirJamController, useAirJamHost, useAirJamShell, useAirJamSocket, useAirJamState, useAudio, useAudioLegacy, useAudioManager, useGetInput, useSendSignal, useVolumeStore };
|