@jgengine/core 0.24.0 → 0.25.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/CHANGELOG.md CHANGED
@@ -26,6 +26,33 @@ At publish, rename this heading to the new version and mirror the entries into
26
26
  `packages/core/src/meta/changelog.ts` (the typed `CHANGELOG` export).
27
27
  -->
28
28
 
29
+ ## 0.25.0
30
+
31
+ ### Migrate
32
+
33
+ - **Bump lockstep SDK packages to `^0.25.0`:** `@jgengine/{core,rapier,react,ws,node,sql,convex,shell,editor,assets,navbake}`. CLI `jgengine` is `0.22.0`; `@jgengine/github` is `0.12.0`.
34
+ - The frame panel from `@jgengine/react/hudPanel` is now `HudSurface` in `@jgengine/react/hudSurface` (`HudSurfaceProps`, `HudSurfaceElevation`). `HudPanel`, `HudPanelProps` and `HudPanelElevation` from `@jgengine/react/hudPanel` stay as deprecated aliases for this release. The `HudCanvas` layout slot keeps the name `HudPanel`.
35
+ - Engine HUD control sounds (button click/hover, panel and window open/close) no longer turn off with `notices: false` or `notices.cues: false`. Set `audio.hudCues: false` to silence them; `notices.cues` now covers notice sounds only.
36
+ - The notice stack now defaults to z-index 85 (was 45), above `ModalHost`. Pass `notices.zIndex` to put it back under a game overlay.
37
+
38
+ ### Added
39
+
40
+ - `HudSurface` takes `as` (`section`, `aside`, `nav`, ...) to render as a landmark.
41
+ - `notices.offset`, `notices.avoidHud` and `notices.zIndex`, with matching `NoticeStack` props. The offset adds to the device safe-area inset.
42
+ - `ctx.game.notices.push({ text, silent: true })` shows a notice without its sound.
43
+
44
+ ### Changed
45
+
46
+ - The engine stylesheet (`@jgengine/react/styles.css` and the injected copy) sits in the `components.jgengine` cascade layer, after a `theme, base, components, utilities` layer order, so plain game CSS and Tailwind utilities override engine buttons and panels without `!important`.
47
+ - `HudSurface` padding comes from `--jg-panel-padding` (default 12px); the `padding` prop sets that variable instead of an inline `padding`, so a game class or media query can override it.
48
+ - `HudButton` labels wrap (`white-space: normal`, line height 1.2, 4px vertical padding) instead of overflowing on one line.
49
+ - The shell renders the notice stack inside the HUD theme root, so notices use the game's `hudTheme` colours and font.
50
+ - A top or bottom notice stack moves clear of `HudCanvas` panels and touch controls registered in its column (Harbor Heat's courier card, action bars).
51
+
52
+ ### Fixed
53
+
54
+ - Flowing `HudCanvas` panels now register their layout region once their anchor region mounts; before, most never registered, so layout collision checks and region consumers missed them.
55
+
29
56
  ## 0.24.0
30
57
 
31
58
  ### Migrate
@@ -10,6 +10,8 @@ export interface NoticeInput {
10
10
  key?: string;
11
11
  /** Lifetime in ms. Defaults to the feed's `ttlMs`, or `denyTtlMs` for deny. */
12
12
  ttlMs?: number;
13
+ /** Skip this push's sound cue (the notice still shows). Default false. */
14
+ silent?: boolean;
13
15
  }
14
16
  /** A live notice as the HUD renders it. */
15
17
  export interface Notice {
@@ -22,6 +24,8 @@ export interface Notice {
22
24
  /** Clock time (ms) of the latest push. */
23
25
  at: number;
24
26
  expiresAt: number;
27
+ /** Set when the latest push asked for no sound cue. */
28
+ silent?: true;
25
29
  }
26
30
  /** Plain JSON state of a {@link NoticeFeed}. */
27
31
  export interface NoticeFeedState {
@@ -33,18 +33,19 @@ export function createNoticeFeed(config = {}) {
33
33
  const key = input.key ?? `${tone}:${input.text}`;
34
34
  const time = now();
35
35
  const life = input.ttlMs ?? (tone === "deny" ? denyTtlMs : ttlMs);
36
+ const quiet = input.silent === true ? { silent: true } : {};
36
37
  const live = prunedAt(time);
37
38
  const index = live.findIndex((notice) => notice.key === key);
38
39
  let notice;
39
40
  if (index >= 0) {
40
- const previous = live[index];
41
- notice = { ...previous, text: input.text, tone, count: previous.count + 1, at: time, expiresAt: time + life };
41
+ const { silent: _previousSilent, ...previous } = live[index];
42
+ notice = { ...previous, text: input.text, tone, count: previous.count + 1, at: time, expiresAt: time + life, ...quiet };
42
43
  const next = [...live];
43
44
  next[index] = notice;
44
45
  set(next);
45
46
  }
46
47
  else {
47
- notice = { id: `notice-${counter}`, text: input.text, tone, key, count: 1, at: time, expiresAt: time + life };
48
+ notice = { id: `notice-${counter}`, text: input.text, tone, key, count: 1, at: time, expiresAt: time + life, ...quiet };
48
49
  counter += 1;
49
50
  const next = [...live, notice];
50
51
  set(cap > 0 && next.length > cap ? next.slice(next.length - cap) : next);
@@ -35,11 +35,17 @@ import type { RarityStyle } from "./worldItem.js";
35
35
  export interface NoticePresentationConfig extends NoticeFeedConfig {
36
36
  /** Screen band for the feed. "top" sits below top-edge HUD bars, "center" over the play area, "bottom" above action bars. Default "top". */
37
37
  placement?: "top" | "center" | "bottom";
38
+ /** Distance from the band's screen edge (px or a CSS length), added to the device safe-area inset. Default `clamp(64px, 14%, 150px)` for top, `clamp(120px, 22%, 230px)` for bottom, 34% for center. */
39
+ offset?: number | string;
40
+ /** Move the top/bottom stack clear of HUD panels and touch controls registered in its column. Default true. */
41
+ avoidHud?: boolean;
42
+ /** Stacking order. Default 85, above `ModalHost` (80) and `PanelHost` (40), so notices stay readable over pause screens. */
43
+ zIndex?: number;
38
44
  /** Keep the feed and cues but render nothing (the game draws `ctx.game.notices` itself). Default false. */
39
45
  hidden?: boolean;
40
46
  /** Show refused commands' `message` as deny notices. Default true. */
41
47
  refusals?: boolean;
42
- /** Play a UI cue per new notice (deny → deny, success → confirm, else notify). Default true. */
48
+ /** Play a UI cue per new notice (deny → deny, success → confirm, else notify); a push with `silent: true` skips its own. Independent of the HUD control sounds (`audio.hudCues`). Default true. */
43
49
  cues?: boolean;
44
50
  }
45
51
  export type { CameraFollowState, CameraKeyframe, CameraProjection, CameraRigKind, CameraWeaponView, CameraShakeConfig, ChaseCameraConfig, ChaseView, CinematicCameraConfig, FirstPersonCameraConfig, GameCameraConfig, InspectionCameraConfig, InspectionZoomAnchor, LockOnCameraConfig, ObserverCameraConfig, PlayerFovConfig, RtsCameraConfig, ShoulderCameraConfig, SideScrollCameraConfig, TopDownCameraConfig, TurntableCameraConfig, } from "./cameraConfig.js";
@@ -708,6 +714,8 @@ export interface PlayableGame<TUi = unknown, TWorldOverlay = unknown, TRenderEnt
708
714
  buses?: Record<string, AudioBusDef>;
709
715
  music?: Record<string, MusicTheme>;
710
716
  musicBus?: string;
717
+ /** Play UI cues for engine HUD controls (`HudButton` click/hover, `HudSurface` and window open/close, action slots). Independent of notice sounds (`notices.cues`). Default true. */
718
+ hudCues?: boolean;
711
719
  /** Default UI cues (`ui.click`, `ui.deny`, ...) on a "ui" bus. A sound named `ui.<cue>` in `sounds` replaces one; a map entry replaces or (`false`) silences one; `false` silences all. */
712
720
  uiCues?: UiCueOverrides;
713
721
  };
@@ -1,5 +1,5 @@
1
1
  /** Installed `@jgengine/core` semver — compare against {@link CHANGELOG} keys when migrating. */
2
- export declare const VERSION = "0.24.0";
2
+ export declare const VERSION = "0.25.0";
3
3
  /** One release's migrate steps plus added/changed/removed notes (typed mirror of CHANGELOG.md). */
4
4
  export interface ChangelogEntry {
5
5
  migrate: readonly string[];
@@ -1,7 +1,29 @@
1
1
  /** Installed `@jgengine/core` semver — compare against {@link CHANGELOG} keys when migrating. */
2
- export const VERSION = "0.24.0";
2
+ export const VERSION = "0.25.0";
3
3
  /** Per-version engine changelog keyed by semver string (e.g. `"0.10.0"`). */
4
4
  export const CHANGELOG = {
5
+ "0.25.0": {
6
+ migrate: [
7
+ "Bump lockstep SDK packages to `^0.25.0`: `@jgengine/{core,rapier,react,ws,node,sql,convex,shell,editor,assets,navbake}`. CLI `jgengine` is `0.22.0`; `@jgengine/github` is `0.12.0`.",
8
+ "The frame panel from `@jgengine/react/hudPanel` is now `HudSurface` in `@jgengine/react/hudSurface` (`HudSurfaceProps`, `HudSurfaceElevation`). `HudPanel`, `HudPanelProps` and `HudPanelElevation` from `@jgengine/react/hudPanel` stay as deprecated aliases for this release. The `HudCanvas` layout slot keeps the name `HudPanel`.",
9
+ "Engine HUD control sounds (button click/hover, panel and window open/close) no longer turn off with `notices: false` or `notices.cues: false`. Set `audio.hudCues: false` to silence them; `notices.cues` now covers notice sounds only.",
10
+ "The notice stack now defaults to z-index 85 (was 45), above `ModalHost`. Pass `notices.zIndex` to put it back under a game overlay.",
11
+ ],
12
+ added: [
13
+ "`HudSurface` takes `as` (`section`, `aside`, `nav`, ...) to render as a landmark.",
14
+ "`notices.offset`, `notices.avoidHud` and `notices.zIndex`, with matching `NoticeStack` props. The offset adds to the device safe-area inset.",
15
+ "`ctx.game.notices.push({ text, silent: true })` shows a notice without its sound.",
16
+ ],
17
+ changed: [
18
+ "The engine stylesheet (`@jgengine/react/styles.css` and the injected copy) sits in the `components.jgengine` cascade layer, after a `theme, base, components, utilities` layer order, so plain game CSS and Tailwind utilities override engine buttons and panels without `!important`.",
19
+ "`HudSurface` padding comes from `--jg-panel-padding` (default 12px); the `padding` prop sets that variable instead of an inline `padding`, so a game class or media query can override it.",
20
+ "`HudButton` labels wrap (`white-space: normal`, line height 1.2, 4px vertical padding) instead of overflowing on one line.",
21
+ "The shell renders the notice stack inside the HUD theme root, so notices use the game's `hudTheme` colours and font.",
22
+ "A top or bottom notice stack moves clear of `HudCanvas` panels and touch controls registered in its column (Harbor Heat's courier card, action bars).",
23
+ "Flowing `HudCanvas` panels now register their layout region once their anchor region mounts; before, most never registered, so layout collision checks and region consumers missed them.",
24
+ ],
25
+ removed: [],
26
+ },
5
27
  "0.24.0": {
6
28
  migrate: [
7
29
  "Bump lockstep SDK packages to `^0.24.0`: `@jgengine/{core,rapier,react,ws,node,sql,convex,shell,editor,assets,navbake}`. CLI `jgengine` is `0.21.0`; `@jgengine/github` is `0.11.0`.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jgengine/core",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "jgengine core — pure-TypeScript game framework SDK (npm @jgengine/core). Entity stores, commands, combat, inventory, multiplayer seams. Zero dependencies. Not an ECS. Agent skills ship in the tarball. https://jgengine.com",
5
5
  "keywords": [
6
6
  "jgengine",
@@ -6,7 +6,7 @@
6
6
 
7
7
  - `CHANGELOG` (const): const CHANGELOG: Record<string, ChangelogEntry> — Per-version engine changelog keyed by semver string (e.g. `"0.10.0"`).
8
8
  - `ChangelogEntry` (interface): interface ChangelogEntry — One release's migrate steps plus added/changed/removed notes (typed mirror of CHANGELOG.md).
9
- - `VERSION` (const): const VERSION: "0.24.0" — Installed `@jgengine/core` semver — compare against {@link CHANGELOG} keys when migrating.
9
+ - `VERSION` (const): const VERSION: "0.25.0" — Installed `@jgengine/core` semver — compare against {@link CHANGELOG} keys when migrating.
10
10
 
11
11
  ## @jgengine/core/authoring
12
12
 
@@ -232,7 +232,7 @@
232
232
 
233
233
  - `CHANGELOG` (const): const CHANGELOG: Record<string, ChangelogEntry> — Per-version engine changelog keyed by semver string (e.g. `"0.10.0"`).
234
234
  - `ChangelogEntry` (interface): interface ChangelogEntry — One release's migrate steps plus added/changed/removed notes (typed mirror of CHANGELOG.md).
235
- - `VERSION` (const): const VERSION: "0.24.0" — Installed `@jgengine/core` semver — compare against {@link CHANGELOG} keys when migrating.
235
+ - `VERSION` (const): const VERSION: "0.25.0" — Installed `@jgengine/core` semver — compare against {@link CHANGELOG} keys when migrating.
236
236
 
237
237
  ## @jgengine/core/runtime/adapter
238
238