@jgengine/react 0.22.0 → 0.24.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 +110 -0
- package/dist/accessibility.d.ts +5 -0
- package/dist/accessibility.js +9 -0
- package/dist/achievements.js +4 -3
- package/dist/actionHud.d.ts +6 -1
- package/dist/actionHud.js +37 -17
- package/dist/bars.js +5 -2
- package/dist/barsPreview.js +2 -1
- package/dist/characterSheet.js +5 -4
- package/dist/coachMarks.js +3 -2
- package/dist/codex.js +4 -3
- package/dist/components.js +9 -2
- package/dist/creditsScreen.js +2 -1
- package/dist/engineStyles.d.ts +18 -0
- package/dist/engineStyles.js +119 -0
- package/dist/fastTravel.js +4 -3
- package/dist/hud.js +7 -6
- package/dist/hudButton.d.ts +29 -0
- package/dist/hudButton.js +31 -0
- package/dist/hudChromePreview.d.ts +8 -0
- package/dist/hudChromePreview.js +27 -0
- package/dist/hudFrame.js +15 -11
- package/dist/hudInteract.d.ts +26 -0
- package/dist/hudInteract.js +28 -0
- package/dist/hudLayout.js +4 -3
- package/dist/hudPanel.d.ts +31 -0
- package/dist/hudPanel.js +32 -0
- package/dist/hudTheme.d.ts +88 -1
- package/dist/hudTheme.js +123 -8
- package/dist/hudThemePreview.js +2 -1
- package/dist/hudThemeRoot.d.ts +15 -0
- package/dist/hudThemeRoot.js +20 -0
- package/dist/hudTokens.d.ts +39 -0
- package/dist/hudTokens.js +56 -0
- package/dist/iconTreatment.js +3 -2
- package/dist/iconsPreview.js +2 -1
- package/dist/keybindingMenu.js +3 -2
- package/dist/map.js +9 -8
- package/dist/modals.d.ts +6 -3
- package/dist/modals.js +42 -52
- package/dist/notices.d.ts +27 -0
- package/dist/notices.js +145 -0
- package/dist/notifications.js +4 -3
- package/dist/panels.d.ts +9 -2
- package/dist/panels.js +78 -35
- package/dist/photoMode.js +2 -1
- package/dist/presence.d.ts +9 -0
- package/dist/presence.js +25 -0
- package/dist/previewFixtures.js +6 -0
- package/dist/questTracker.js +3 -2
- package/dist/quickMenu.js +6 -5
- package/dist/saveSlots.js +4 -3
- package/dist/selectionHud.js +4 -3
- package/dist/shopGrid.js +2 -1
- package/dist/statusEffectBar.js +2 -1
- package/dist/streetGeometryPreview.js +3 -2
- package/dist/styles.css +72 -0
- package/dist/talentTree.js +3 -2
- package/dist/tweenNumber.d.ts +37 -0
- package/dist/tweenNumber.js +66 -0
- package/dist/uiCues.d.ts +20 -0
- package/dist/uiCues.js +37 -0
- package/dist/waveHud.js +2 -1
- package/dist/waypointMarkers.js +2 -1
- package/package.json +10 -6
- package/skills/jgengine/api.md +18 -18
- package/skills/jgengine-ui/SKILL.md +4 -0
- package/skills/jgengine-ui/api.md +254 -37
- package/skills/jgengine-ui/capabilities.md +58 -0
- package/skills/jgengine-ui/reference-primitives.md +4 -4
|
@@ -69,6 +69,10 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
|
|
|
69
69
|
|
|
70
70
|
- `useAutoScroll` (function) · `import { useAutoScroll } from "@jgengine/react"`
|
|
71
71
|
|
|
72
|
+
## balance-ibl-lighting — trim flat ambient under IBL and add a key light to directionless lighting
|
|
73
|
+
|
|
74
|
+
- `balanceLightingForIbl` (function) · `import { balanceLightingForIbl } from "@jgengine/core/render/lightingBalance"`
|
|
75
|
+
|
|
72
76
|
## bounded-spatial-audio — play positional or flat cues with listener orientation, voice budgets, and per-source cleanup
|
|
73
77
|
|
|
74
78
|
- `createAudioEngine` (function) · `import { createAudioEngine } from "@jgengine/shell/audio/audioEngine"`
|
|
@@ -210,6 +214,10 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
|
|
|
210
214
|
|
|
211
215
|
- `useDragLayer` (function) · `import { useDragLayer } from "@jgengine/react"`
|
|
212
216
|
|
|
217
|
+
## engine-styles — inject the engine stylesheet (jg-* keyframes, interaction states, reduced motion) once
|
|
218
|
+
|
|
219
|
+
- `useEngineStyles` (function) · `import { useEngineStyles } from "@jgengine/react/engineStyles"`
|
|
220
|
+
|
|
213
221
|
## entity-frames — overlay that renders caller-composed frames over on-screen entities
|
|
214
222
|
|
|
215
223
|
- `EntityFrames` (function) · `import { EntityFrames } from "@jgengine/react"`
|
|
@@ -258,6 +266,12 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
|
|
|
258
266
|
|
|
259
267
|
- `GameContextBridge` (function) · `import { GameContextBridge } from "@jgengine/react"`
|
|
260
268
|
|
|
269
|
+
## ground-edge-fade — fade merged ground layers into the terrain at their outer edge, keeping inner seams crisp
|
|
270
|
+
|
|
271
|
+
- `applyGroundEdgeFade` (function) · `import { applyGroundEdgeFade } from "@jgengine/shell/terrain"`
|
|
272
|
+
- `buildGroundCoverageMask` (function) · `import { buildGroundCoverageMask } from "@jgengine/shell/terrain"`
|
|
273
|
+
- `createGroundEdgeFade` (function) · `import { createGroundEdgeFade } from "@jgengine/shell/terrain"`
|
|
274
|
+
|
|
261
275
|
## heavy-models — models over the per-model triangle budget, for perf probes and smoke assertions
|
|
262
276
|
|
|
263
277
|
- `heavyModels` (function) · `import { heavyModels } from "@jgengine/shell/render/modelLoad"`
|
|
@@ -266,6 +280,10 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
|
|
|
266
280
|
|
|
267
281
|
- `displaceHeightfieldGeometry` (function) · `import { displaceHeightfieldGeometry } from "@jgengine/shell/terrain"`
|
|
268
282
|
|
|
283
|
+
## hud-button — themed button with hover lift, press scale, focus ring, disabled state, and an interaction cue seam
|
|
284
|
+
|
|
285
|
+
- `HudButton` (const) · `import { HudButton } from "@jgengine/react/hudButton"`
|
|
286
|
+
|
|
269
287
|
## hud-canvas — the HUD root surface — design-resolution scaling plus live panel-placement editing (F2+C)
|
|
270
288
|
|
|
271
289
|
- `HudCanvas` (function) · `import { HudCanvas } from "@jgengine/react"`
|
|
@@ -290,6 +308,10 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
|
|
|
290
308
|
|
|
291
309
|
- `IconSchool` (type) · `import { IconSchool } from "@jgengine/react"`
|
|
292
310
|
|
|
311
|
+
## hud-interact — one listener for hover/press/activate/open/close from every engine HUD primitive
|
|
312
|
+
|
|
313
|
+
- `HudInteractProvider` (function) · `import { HudInteractProvider } from "@jgengine/react/hudInteract"`
|
|
314
|
+
|
|
293
315
|
## hud-layout — persistent, live-editable HUD panel layout state for `HudCanvas`
|
|
294
316
|
|
|
295
317
|
- `useHudLayout` (function) · `import { useHudLayout } from "@jgengine/react"`
|
|
@@ -326,10 +348,18 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
|
|
|
326
348
|
|
|
327
349
|
- `deriveHudTheme` (function) · `import { deriveHudTheme } from "@jgengine/react"`
|
|
328
350
|
|
|
351
|
+
## hud-theme-root — apply the default (or a game) HudTheme and the engine stylesheet at the HUD root
|
|
352
|
+
|
|
353
|
+
- `HudThemeRoot` (function) · `import { HudThemeRoot } from "@jgengine/react/hudThemeRoot"`
|
|
354
|
+
|
|
329
355
|
## hud-ticker — re-render a HUD element at a steady hz for time-derived readouts (cooldowns, cast/swing bars) — no hand-rolled setInterval effects
|
|
330
356
|
|
|
331
357
|
- `useTicker` (function) · `import { useTicker } from "@jgengine/react"`
|
|
332
358
|
|
|
359
|
+
## hud-tokens — inline-style accessors for the HudTheme type scale, spacing, motion, elevation, and focus ring
|
|
360
|
+
|
|
361
|
+
- `HudTypeStep` (type) · `import { HudTypeStep } from "@jgengine/react/hudTokens"`
|
|
362
|
+
|
|
333
363
|
## hud-vitals — atomic purpose-named vitals bars (token-themed parts, not a finished HUD)
|
|
334
364
|
|
|
335
365
|
- `BarTokens` (interface) · `import { BarTokens } from "@jgengine/react"`
|
|
@@ -414,6 +444,10 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
|
|
|
414
444
|
|
|
415
445
|
- `menuStackReducer` (function) · `import { menuStackReducer } from "@jgengine/react/menuRouter"`
|
|
416
446
|
|
|
447
|
+
## merge-post-processing — layer a partial post chain over a look preset without losing its stages
|
|
448
|
+
|
|
449
|
+
- `mergePostProcessing` (function) · `import { mergePostProcessing } from "@jgengine/core/render/lookPreset"`
|
|
450
|
+
|
|
417
451
|
## minimap — framed circular minimap with terrain bake, fog, markers, and facing arrow
|
|
418
452
|
|
|
419
453
|
- `Minimap` (function) · `import { Minimap } from "@jgengine/react"`
|
|
@@ -456,6 +490,10 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
|
|
|
456
490
|
|
|
457
491
|
- `modelLoadIdleMs` (function) · `import { modelLoadIdleMs } from "@jgengine/shell/render/modelLoad"`
|
|
458
492
|
|
|
493
|
+
## model-load-starts — count of model streaming bursts, for capture quiescence checks
|
|
494
|
+
|
|
495
|
+
- `modelLoadStarts` (function) · `import { modelLoadStarts } from "@jgengine/shell/render/modelLoad"`
|
|
496
|
+
|
|
459
497
|
## multiplayer-p2p — bootstrap a playable authoritative world for browser peer co-op
|
|
460
498
|
|
|
461
499
|
- `resolvePeerShellMultiplayer` (function) · `import { resolvePeerShellMultiplayer } from "@jgengine/shell/multiplayer"`
|
|
@@ -464,6 +502,10 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
|
|
|
464
502
|
|
|
465
503
|
- `WorldNameplates` (function) · `import { WorldNameplates } from "@jgengine/shell/world/WorldHud"`
|
|
466
504
|
|
|
505
|
+
## notice-feed — render ctx.game.notices as an animated toned stack (enter/exit motion, ×N stacking)
|
|
506
|
+
|
|
507
|
+
- `NoticeStack` (function) · `import { NoticeStack } from "@jgengine/react/notices"`
|
|
508
|
+
|
|
467
509
|
## notification-bell — icon button with a live unread-count badge over a notification store
|
|
468
510
|
|
|
469
511
|
- `NotificationBell` (function) · `import { NotificationBell } from "@jgengine/react"`
|
|
@@ -553,6 +595,10 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
|
|
|
553
595
|
|
|
554
596
|
- `Popover` (function) · `import { Popover } from "@jgengine/react"`
|
|
555
597
|
|
|
598
|
+
## presence — keep a closing element mounted through its exit transition
|
|
599
|
+
|
|
600
|
+
- `usePresence` (function) · `import { usePresence } from "@jgengine/react/presence"`
|
|
601
|
+
|
|
556
602
|
## projected-overdraw — sample actual mesh/camera fragment overlap with native coverage and explicit depth/blending/transmission limits
|
|
557
603
|
|
|
558
604
|
- `measureProjectedOverdraw` (function) · `import { measureProjectedOverdraw } from "@jgengine/shell/render/projectedOverdraw"`
|
|
@@ -698,6 +744,18 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
|
|
|
698
744
|
|
|
699
745
|
- `TransformGizmo` (const) · `import { TransformGizmo } from "@jgengine/shell/structures"`
|
|
700
746
|
|
|
747
|
+
## tween-number — rolling number readout with an up/down delta flash
|
|
748
|
+
|
|
749
|
+
- `TweenNumber` (function) · `import { TweenNumber } from "@jgengine/react/tweenNumber"`
|
|
750
|
+
|
|
751
|
+
## tweened-value — animate a displayed number toward its target, honouring reduced motion
|
|
752
|
+
|
|
753
|
+
- `useTweenedValue` (function) · `import { useTweenedValue } from "@jgengine/react/tweenNumber"`
|
|
754
|
+
|
|
755
|
+
## ui-sound-cues — play click/hover/open/close/confirm/deny/notify UI sounds from any component
|
|
756
|
+
|
|
757
|
+
- `useUiCue` (function) · `import { useUiCue } from "@jgengine/react/uiCues"`
|
|
758
|
+
|
|
701
759
|
## use-camera-shake — React hook binding a camera-shake controller — subscribes for live trauma/kind and can self-drive its decay on a frame loop
|
|
702
760
|
|
|
703
761
|
- `useCameraShake` (function) · `import { useCameraShake } from "@jgengine/react"`
|
|
@@ -70,7 +70,7 @@ instead of mirroring external entities into `createMarkerSet`.
|
|
|
70
70
|
|
|
71
71
|
**Toggleable game windows** are already shipped, not hand-rolled open/close state: `usePanels(defs)` + `<PanelHost>` + `<Window>` (`@jgengine/react`) over the headless `@jgengine/core/ui/panelModel` are THE way to build openable windows — bag (`B`), character (`C`), spellbook, quest log — with keybind toggles, drag-to-move, close buttons, ESC-to-close, and z-stack ordering all handled. Declare each window in `defs` (id, keybind, title), mount one `<PanelHost>`, and render each panel's body inside a `<Window>`; the game owns the body content and skin, the model owns focus/stacking/keybind wiring. Never re-derive window toggling from local `useState` booleans and hand-rolled keydown listeners.
|
|
72
72
|
|
|
73
|
-
Window title-bar movement belongs to one primary pointer. Release, cancellation, capture loss, blur, and window unmount retire that gesture's listeners; another pointer cannot move it. Controlled positions and panel z-order remain caller-owned.
|
|
73
|
+
Window title-bar movement belongs to one primary pointer. Release, cancellation, capture loss, blur, and window unmount retire that gesture's listeners; another pointer cannot move it. Controlled positions and panel z-order remain caller-owned. Windows without a `variation` render on `HudPanel` (theme frame plus modal elevation) and rise in on open; `PanelHost` keeps a closed window mounted for its short exit transition, and closing retires any drag in progress. `ModalHost` fades its backdrop and lifts the dialog in, and plays the same exit when the stack empties; `ConfirmDialog` and `PauseMenu` are built from `HudPanel` and `HudButton`.
|
|
74
74
|
|
|
75
75
|
**Character sheet / paperdoll** is already shipped, not hand-rolled: `<CharacterSheet>` / `<Paperdoll>` / `<StatList>` (`@jgengine/react`) compose the paperdoll equip layout (worn `EquipmentSlots` arranged around a portrait) and the derived-stat readout into one window body. `Paperdoll` is the equip-slot arrangement, `StatList` the derived-stat rows, `CharacterSheet` the batteries-included default that pairs them — the game composes and reskins them (slot layout, stat labels/terminology, skin) rather than re-deriving a paperdoll from raw divs and manual stat math.
|
|
76
76
|
|
|
@@ -80,21 +80,21 @@ Do not create a primitive whose only value is wrapping a `div` with border radiu
|
|
|
80
80
|
|
|
81
81
|
## Rendering — post-processing, lighting, shadows
|
|
82
82
|
|
|
83
|
-
**Look presets.** Unset `look` is `"neutral"` (#1719): the game's own `lighting`/`backdrop`/`postProcessing` with an AgX tone-map and no styling. One field picks a whole art direction: `"photoreal"` (high-contrast PBR post), `"cinematic"` (day sky, view-following shadow-casting sun, tone-map/bloom/SSAO/vignette), `"toon"` (clean graphic grade), `"comic"` (ink outlines + cel bands + saturated grade — Borderlands-style), `"retro"` (pixelated, posterized, no smoothing), and `"flat"` (bare ambient+directional rig, no post). Non-neutral presets add a day sky unless the world declares one. The preset only fills knobs you didn't set — any explicit `lighting`/`backdrop
|
|
83
|
+
**Look presets.** Unset `look` is `"neutral"` (#1719): the game's own `lighting`/`backdrop`/`postProcessing` with an AgX tone-map and no styling. One field picks a whole art direction: `"photoreal"` (high-contrast PBR post), `"cinematic"` (day sky, view-following shadow-casting sun, tone-map/bloom/SSAO/vignette), `"toon"` (clean graphic grade), `"comic"` (ink outlines + cel bands + saturated grade — Borderlands-style), `"retro"` (pixelated, posterized, no smoothing), and `"flat"` (bare ambient+directional rig, no post). Non-neutral presets add a day sky unless the world declares one. The preset only fills knobs you didn't set — any explicit `lighting`/`backdrop` wins, and a styled preset's post stages deep-merge under a partial `postProcessing` (`mergePostProcessing`): fields you set, including `false`, win; stages you omit come from the preset. Under `"neutral"` your chain is used as authored. `resolveGameLook` (`@jgengine/core/render/lookPreset`) is the pure resolver; assert on it in a `bun test` (the post/sky layers are not visible to `summarizeEnvironment`). HUD-presentation and no-camera games are unaffected.
|
|
84
84
|
|
|
85
85
|
The post chain itself is never hand-wired render passes. Set `defineGame({ postProcessing })` (`PostProcessingConfig` from `@jgengine/core/render/postProcessing`) and the shell mounts an `EffectComposer` and owns the render: RenderPass → AO → Bloom → tone-map output → Stylize → Grade. Each stage is a config object, `false` to skip, or omitted for its tuned default:
|
|
86
86
|
|
|
87
87
|
- `toneMapping: "aces" | "agx" | "reinhard" | "cineon" | "linear" | "none"` (default `aces`) + `exposure`.
|
|
88
88
|
- `bloom: { strength, radius, threshold }` — HDR glow around bright pixels (defaults 0.32 / 0.55 / 0.85).
|
|
89
89
|
- `grade: { lift, gain, gamma, saturation, vignette, grain }` — display-space colour grade: cool-shadow/warm-highlight split, vignette, animated film grain.
|
|
90
|
-
- `ao: { radius, intensity, distanceFalloff, blend }` — ground-truth ambient occlusion
|
|
90
|
+
- `ao: { radius, intensity, distanceFalloff, blend }` — ground-truth ambient occlusion. Omitted runs `DEFAULT_AO` on tiers whose `postStages.ao` is on (medium and up; low skips it); `ao: false` turns it off everywhere. It adds a normal/depth prepass (one extra draw per opaque mesh) and is fill-heavy: 8 samples on medium, 12 on high, 16 on ultra.
|
|
91
91
|
- `stylize: { outline, bands, pixelSize }` — art style without touching materials. `outline: { color, thickness, opacity, depthThreshold, normalThreshold, fadeDistance }` traces ink lines from depth and normal edges (one extra normal/depth scene render, shadow maps reused); `bands` quantizes brightness into cel bands keeping hue; `pixelSize` snaps the frame to retro blocks. Mix freely: outline alone is a clean comic ink, `bands: 3` plus outline is cartoon, `pixelSize` plus `bands` is retro. Mark custom overlay effects with `POSTFX_OVERLAY_USERDATA` so they are not outlined; transparent, alpha-cut, points, lines and sprites are skipped automatically.
|
|
92
92
|
|
|
93
93
|
AO and depth-of-field prepasses reuse the beauty pass's shadow maps; they do not redraw shadow casters. Prepass failure restores shadow update policy and marked overlay visibility. The composer resizes passes through `setSize`, and graph cleanup calls each pass's `dispose` once; avoid reading a pass's internal targets or materials.
|
|
94
94
|
|
|
95
95
|
**Orbit camera occlusion:** the third-person orbit rig takes `camera: { collision: { enabled, padding?, minTargetDistance? } }` — a spring-arm that raycasts target→camera each frame and pulls the boom in past walls/terrain so the camera never clips inside geometry. Off by default (unchanged chase feel); enable it for any world with interiors or dense structures.
|
|
96
96
|
|
|
97
|
-
Lighting is `defineGame({ lighting })` (`LightingConfig`): ambient / hemisphere / directional, replacing the shell's default lights when set. A `DirectionalLightingConfig` with `castShadow` takes `shadowMapSize`, `shadowCameraSize`, `shadowBias`, `shadowNormalBias`
|
|
97
|
+
Lighting is `defineGame({ lighting })` (`LightingConfig`): ambient / hemisphere / directional, replacing the shell's default lights when set. A `DirectionalLightingConfig` with `castShadow` takes `shadowMapSize`, `shadowCameraSize`, `shadowBias`, `shadowNormalBias` and `shadowRadius` (PCF penumbra in texels, default 1.25; the shell uses `PCFShadowMap` — in three r182 `PCFSoftShadowMap` silently compiles as unfiltered basic shadows). Every look but `"flat"` adds image-based light from a procedural sky probe (sky/horizon/ground from `hemisphere`, an HDR sun lobe from the first directional light, horizon leaning toward the ambient colour, intensity 0.45); `environmentSource` swaps in an HDRI or cube map. Under that IBL, `ambient` intensity is scaled by `iblAmbientScale` (default 0.5; set 1 to keep it), and lighting with no `directional` entry gets a soft shadowless key tinted by the ambient colour unless `fallbackKey: false` (`balanceLightingForIbl` in `@jgengine/core/render/lightingBalance`). Sky-lit worlds (a `sky()` world feature) get a high-res sun whose shadow camera follows the view each frame, so grounded shadows stay sharp under the player anywhere in a large world.
|
|
98
98
|
|
|
99
99
|
## First-person viewmodel, WorldOverlay props, render cues (#542)
|
|
100
100
|
|