@thewhateverapp/tile-sdk 0.19.0 → 0.20.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.
@@ -0,0 +1,48 @@
1
+ type HowlStatic = any;
2
+ export interface SoundOptions {
3
+ volume?: number;
4
+ loop?: boolean;
5
+ rate?: number;
6
+ sprite?: Record<string, [number, number]>;
7
+ onload?: () => void;
8
+ onloaderror?: (id: number, error: any) => void;
9
+ onplay?: () => void;
10
+ onend?: () => void;
11
+ onstop?: () => void;
12
+ onpause?: () => void;
13
+ }
14
+ export interface SoundController {
15
+ play: (spriteId?: string) => void;
16
+ pause: () => void;
17
+ stop: () => void;
18
+ volume: (vol?: number) => number | void;
19
+ rate: (rate?: number) => number | void;
20
+ loop: (loop?: boolean) => boolean | void;
21
+ playing: () => boolean;
22
+ duration: () => number;
23
+ state: () => 'unloaded' | 'loading' | 'loaded';
24
+ unload: () => void;
25
+ }
26
+ /**
27
+ * Hook for playing sound effects
28
+ *
29
+ * @param src - URL to the audio file
30
+ * @param options - Howler options
31
+ * @returns Sound controller
32
+ */
33
+ export declare function useSound(src: string, options?: SoundOptions): SoundController;
34
+ /**
35
+ * Hook for playing background music with auto-play on mount
36
+ *
37
+ * @param src - URL to the music file
38
+ * @param options - Howler options (loop defaults to true for music)
39
+ * @returns Sound controller
40
+ */
41
+ export declare function useMusic(src: string, options?: SoundOptions): SoundController;
42
+ /**
43
+ * Re-export Howl for advanced use cases
44
+ * Returns null during SSR, the Howl class after client-side load
45
+ */
46
+ export declare function getHowl(): Promise<HowlStatic | null>;
47
+ export {};
48
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/audio/index.ts"],"names":[],"mappings":"AA4BA,KAAK,UAAU,GAAG,GAAG,CAAC;AA6BtB,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,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,CAgBjF;AAED;;;GAGG;AACH,wBAAsB,OAAO,IAAI,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAI1D"}
@@ -0,0 +1,182 @@
1
+ 'use client';
2
+ /**
3
+ * Audio SDK for tile-sdk
4
+ *
5
+ * SSR-safe wrapper around Howler.js with React hooks for easy audio management.
6
+ * Handles dynamic import, lifecycle management, and provides a clean API.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * import { useSound, useMusic } from '@thewhateverapp/tile-sdk/audio';
11
+ *
12
+ * function MyGame() {
13
+ * const jumpSound = useSound('/sounds/jump.mp3');
14
+ * const bgMusic = useMusic('/music/theme.mp3', { volume: 0.3, loop: true });
15
+ *
16
+ * return (
17
+ * <button onClick={() => jumpSound.play()}>
18
+ * Jump
19
+ * </button>
20
+ * );
21
+ * }
22
+ * ```
23
+ */
24
+ import { useEffect, useRef, useState } from 'react';
25
+ let Howl = null;
26
+ let howlerLoaded = false;
27
+ let howlerPromise = null;
28
+ /**
29
+ * Load Howler dynamically (client-side only)
30
+ */
31
+ async function loadHowler() {
32
+ if (typeof window === 'undefined') {
33
+ throw new Error('Howler can only be loaded in the browser');
34
+ }
35
+ if (howlerLoaded)
36
+ return;
37
+ if (howlerPromise) {
38
+ return howlerPromise;
39
+ }
40
+ howlerPromise = import('howler').then((module) => {
41
+ Howl = module.Howl;
42
+ howlerLoaded = true;
43
+ });
44
+ return howlerPromise;
45
+ }
46
+ /**
47
+ * Hook for playing sound effects
48
+ *
49
+ * @param src - URL to the audio file
50
+ * @param options - Howler options
51
+ * @returns Sound controller
52
+ */
53
+ export function useSound(src, options = {}) {
54
+ const [isLoaded, setIsLoaded] = useState(false);
55
+ const howlRef = useRef(null);
56
+ useEffect(() => {
57
+ let cancelled = false;
58
+ loadHowler().then(() => {
59
+ if (cancelled || !Howl)
60
+ return;
61
+ const howl = new Howl({
62
+ src: [src],
63
+ volume: options.volume ?? 1.0,
64
+ loop: options.loop ?? false,
65
+ rate: options.rate ?? 1.0,
66
+ sprite: options.sprite,
67
+ onload: () => {
68
+ setIsLoaded(true);
69
+ options.onload?.();
70
+ },
71
+ onloaderror: options.onloaderror,
72
+ onplay: options.onplay,
73
+ onend: options.onend,
74
+ onstop: options.onstop,
75
+ onpause: options.onpause,
76
+ });
77
+ howlRef.current = howl;
78
+ }).catch(err => {
79
+ console.error('[useSound] Failed to load Howler:', err);
80
+ });
81
+ return () => {
82
+ cancelled = true;
83
+ if (howlRef.current) {
84
+ howlRef.current.unload();
85
+ howlRef.current = null;
86
+ }
87
+ };
88
+ }, [src]);
89
+ return {
90
+ play: (spriteId) => {
91
+ if (howlRef.current) {
92
+ howlRef.current.play(spriteId);
93
+ }
94
+ },
95
+ pause: () => {
96
+ if (howlRef.current) {
97
+ howlRef.current.pause();
98
+ }
99
+ },
100
+ stop: () => {
101
+ if (howlRef.current) {
102
+ howlRef.current.stop();
103
+ }
104
+ },
105
+ volume: (vol) => {
106
+ if (howlRef.current) {
107
+ if (vol !== undefined) {
108
+ howlRef.current.volume(vol);
109
+ }
110
+ else {
111
+ return howlRef.current.volume();
112
+ }
113
+ }
114
+ },
115
+ rate: (rate) => {
116
+ if (howlRef.current) {
117
+ if (rate !== undefined) {
118
+ howlRef.current.rate(rate);
119
+ }
120
+ else {
121
+ return howlRef.current.rate();
122
+ }
123
+ }
124
+ },
125
+ loop: (loop) => {
126
+ if (howlRef.current) {
127
+ if (loop !== undefined) {
128
+ howlRef.current.loop(loop);
129
+ }
130
+ else {
131
+ return howlRef.current.loop();
132
+ }
133
+ }
134
+ },
135
+ playing: () => {
136
+ return howlRef.current ? howlRef.current.playing() : false;
137
+ },
138
+ duration: () => {
139
+ return howlRef.current ? howlRef.current.duration() : 0;
140
+ },
141
+ state: () => {
142
+ return howlRef.current ? howlRef.current.state() : 'unloaded';
143
+ },
144
+ unload: () => {
145
+ if (howlRef.current) {
146
+ howlRef.current.unload();
147
+ howlRef.current = null;
148
+ }
149
+ },
150
+ };
151
+ }
152
+ /**
153
+ * Hook for playing background music with auto-play on mount
154
+ *
155
+ * @param src - URL to the music file
156
+ * @param options - Howler options (loop defaults to true for music)
157
+ * @returns Sound controller
158
+ */
159
+ export function useMusic(src, options = {}) {
160
+ const sound = useSound(src, {
161
+ loop: true, // Music usually loops
162
+ ...options,
163
+ });
164
+ const hasAutoPlayed = useRef(false);
165
+ useEffect(() => {
166
+ if (sound.state() === 'loaded' && !hasAutoPlayed.current) {
167
+ hasAutoPlayed.current = true;
168
+ sound.play();
169
+ }
170
+ }, [sound.state()]);
171
+ return sound;
172
+ }
173
+ /**
174
+ * Re-export Howl for advanced use cases
175
+ * Returns null during SSR, the Howl class after client-side load
176
+ */
177
+ export async function getHowl() {
178
+ if (typeof window === 'undefined')
179
+ return null;
180
+ await loadHowler();
181
+ return Howl;
182
+ }
package/dist/index.d.ts CHANGED
@@ -19,21 +19,4 @@ export type { TileStats, ViewResponse } from './state/StateClient.js';
19
19
  export * from './tools/index.js';
20
20
  export * from './types.js';
21
21
  export * from './templates/index.js';
22
- export { ExcaliburGame, useEngine, useScene, useGameLoop, useGameState, useGameInput, GAME_WIDTH, GAME_HEIGHT, } from './react/ExcaliburGame.js';
23
- export type { ExcaliburGameProps } from './react/ExcaliburGame.js';
24
- export { Actor, Vector, Color, Engine, Scene, Timer, Trigger, Label, } from './react/ExcaliburGame.js';
25
- export { Sprite, SpriteSheet, Animation, AnimationStrategy, AnimationDirection, Graphic, GraphicsGroup, Rectangle, Circle, Polygon, Line, Text, Font, Canvas, ImageFiltering, ImageWrapping, } from './react/ExcaliburGame.js';
26
- export { ImageSource, Sound, Loader, DefaultLoader, Resource, Gif, } from './react/ExcaliburGame.js';
27
- export { CollisionType, CollisionGroup, CollisionGroupManager, BoundingBox, Shape, CircleCollider, PolygonCollider, EdgeCollider, CompositeCollider, BodyComponent, ColliderComponent, Side, PhysicsConfig, } from './react/ExcaliburGame.js';
28
- export { Keys, Buttons, Axes, Gamepads, Gamepad, PointerScope, PointerButton, } from './react/ExcaliburGame.js';
29
- export { ActionContext, ActionsComponent, EasingFunctions, } from './react/ExcaliburGame.js';
30
- export { ParticleEmitter, EmitterType, } from './react/ExcaliburGame.js';
31
- export { TileMap, Tile, IsometricTile, IsometricMap, } from './react/ExcaliburGame.js';
32
- export { Entity, Component, TransformComponent, MotionComponent, GraphicsComponent, System, SystemType, Query, World, } from './react/ExcaliburGame.js';
33
- export { vec, Ray, Random, clamp, toRadians, toDegrees, } from './react/ExcaliburGame.js';
34
- export { Camera } from './react/ExcaliburGame.js';
35
- export { DisplayMode, ScreenElement } from './react/ExcaliburGame.js';
36
- export { PreUpdateEvent, PostUpdateEvent, PreDrawEvent, PostDrawEvent, CollisionStartEvent, CollisionEndEvent, PreCollisionEvent, PostCollisionEvent, EnterViewPortEvent, ExitViewPortEvent, } from './react/ExcaliburGame.js';
37
- export { coroutine } from './react/ExcaliburGame.js';
38
- export { Logger, LogLevel, EasingFunction } from './react/ExcaliburGame.js';
39
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACpE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG/C,OAAO,EAEL,WAAW,EACX,aAAa,EACb,QAAQ,EAAE,0BAA0B;AACpC,WAAW,EACX,YAAY,EACZ,gBAAgB,EAEhB,SAAS,EACT,i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AAwB,CAAC;AACnE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGrI,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtE,cAAc,kBAAkB,CAAC;AAGjC,cAAc,YAAY,CAAC;AAG3B,cAAc,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -28,37 +28,13 @@ export * from './types.js';
28
28
  // Templates (for tile-deploy/agent-service)
29
29
  export * from './templates/index.js';
30
30
  // =============================================================================
31
- // Excalibur Game Engine (re-exported for top-level access)
31
+ // Excalibur Game Engine
32
+ // =============================================================================
33
+ // IMPORTANT: Excalibur exports have been moved to a subpath to avoid ESM/CJS
34
+ // compatibility issues in Node.js environments.
35
+ //
36
+ // Use: import { ExcaliburGame, Actor, Vector, ... } from '@thewhateverapp/tile-sdk/excalibur'
37
+ //
38
+ // This allows the main package to be imported in Node.js without requiring
39
+ // the excalibur peer dependency to be installed.
32
40
  // =============================================================================
33
- // React components and hooks for Excalibur
34
- export { ExcaliburGame, useEngine, useScene, useGameLoop, useGameState, useGameInput, GAME_WIDTH, GAME_HEIGHT, } from './react/ExcaliburGame.js';
35
- // Core Excalibur classes
36
- export { Actor, Vector, Color, Engine, Scene, Timer, Trigger, Label, } from './react/ExcaliburGame.js';
37
- // Graphics - Shapes & Sprites
38
- export { Sprite, SpriteSheet, Animation, AnimationStrategy, AnimationDirection, Graphic, GraphicsGroup, Rectangle, Circle, Polygon, Line, Text, Font, Canvas, ImageFiltering, ImageWrapping, } from './react/ExcaliburGame.js';
39
- // Resources - Loading assets
40
- export { ImageSource, Sound, Loader, DefaultLoader, Resource, Gif, } from './react/ExcaliburGame.js';
41
- // Collision & Physics
42
- export { CollisionType, CollisionGroup, CollisionGroupManager, BoundingBox, Shape, CircleCollider, PolygonCollider, EdgeCollider, CompositeCollider, BodyComponent, ColliderComponent, Side, } from './react/ExcaliburGame.js';
43
- // Input
44
- export { Keys, Buttons, Axes, Gamepads, Gamepad, PointerScope, PointerButton, } from './react/ExcaliburGame.js';
45
- // Actions (movement, animation sequences)
46
- export { ActionContext, ActionsComponent, EasingFunctions, } from './react/ExcaliburGame.js';
47
- // Particles
48
- export { ParticleEmitter, EmitterType, } from './react/ExcaliburGame.js';
49
- // Tile Maps
50
- export { TileMap, Tile, IsometricTile, IsometricMap, } from './react/ExcaliburGame.js';
51
- // Entity Component System
52
- export { Entity, Component, TransformComponent, MotionComponent, GraphicsComponent, System, SystemType, Query, World, } from './react/ExcaliburGame.js';
53
- // Math utilities
54
- export { vec, Ray, Random, clamp, toRadians, toDegrees, } from './react/ExcaliburGame.js';
55
- // Camera
56
- export { Camera } from './react/ExcaliburGame.js';
57
- // Display
58
- export { DisplayMode, ScreenElement } from './react/ExcaliburGame.js';
59
- // Events
60
- export { PreUpdateEvent, PostUpdateEvent, PreDrawEvent, PostDrawEvent, CollisionStartEvent, CollisionEndEvent, PreCollisionEvent, PostCollisionEvent, EnterViewPortEvent, ExitViewPortEvent, } from './react/ExcaliburGame.js';
61
- // Coroutines
62
- export { coroutine } from './react/ExcaliburGame.js';
63
- // Utilities
64
- export { Logger, LogLevel } from './react/ExcaliburGame.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thewhateverapp/tile-sdk",
3
- "version": "0.19.0",
3
+ "version": "0.20.1",
4
4
  "description": "SDK for building interactive tiles on The Whatever App platform",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -13,6 +13,10 @@
13
13
  "types": "./dist/excalibur/index.d.ts",
14
14
  "import": "./dist/excalibur/index.js"
15
15
  },
16
+ "./audio": {
17
+ "types": "./dist/audio/index.d.ts",
18
+ "import": "./dist/audio/index.js"
19
+ },
16
20
  "./spec": {
17
21
  "types": "./dist/spec/index.d.ts",
18
22
  "import": "./dist/spec/index.js"
@@ -55,20 +59,26 @@
55
59
  "peerDependencies": {
56
60
  "react": "^18.0.0",
57
61
  "react-dom": "^18.0.0",
58
- "excalibur": "^0.29.0"
62
+ "excalibur": "^0.29.0",
63
+ "howler": "^2.2.0"
59
64
  },
60
65
  "peerDependenciesMeta": {
61
66
  "excalibur": {
62
67
  "optional": true
68
+ },
69
+ "howler": {
70
+ "optional": true
63
71
  }
64
72
  },
65
73
  "devDependencies": {
74
+ "@types/howler": "^2.2.11",
66
75
  "@types/matter-js": "^0.19.0",
67
76
  "@types/node": "^20.0.0",
68
77
  "@types/react": "^18.2.48",
69
78
  "@types/react-dom": "^18.2.18",
70
79
  "eslint": "^9.39.1",
71
80
  "excalibur": "^0.29.3",
81
+ "howler": "^2.2.4",
72
82
  "next": "^14.2.0",
73
83
  "tsx": "^4.7.0",
74
84
  "typescript": "^5.3.3"