aispritejs 0.1.1 → 0.1.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.
- package/README.md +2 -2
- package/README_ZHTW.md +2 -2
- package/dist/atlas/index.cjs +60 -17
- package/dist/atlas/index.cjs.map +1 -1
- package/dist/atlas/index.d.cts +1 -1
- package/dist/atlas/index.d.ts +1 -1
- package/dist/atlas/index.js +60 -17
- package/dist/atlas/index.js.map +1 -1
- package/dist/index.cjs +31 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +31 -13
- package/dist/index.js.map +1 -1
- package/dist/pixi/index.cjs +31 -13
- package/dist/pixi/index.cjs.map +1 -1
- package/dist/pixi/index.d.cts +1 -1
- package/dist/pixi/index.d.ts +1 -1
- package/dist/pixi/index.js +31 -13
- package/dist/pixi/index.js.map +1 -1
- package/dist/{types-DKMFvfx9.d.cts → types-BS72pefJ.d.cts} +8 -2
- package/dist/{types-DKMFvfx9.d.ts → types-BS72pefJ.d.ts} +8 -2
- package/llms-full.txt +15 -2
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/schemas/aispritejs-graph.schema.json +2 -1
|
@@ -234,9 +234,15 @@ interface SpriteAnimator {
|
|
|
234
234
|
reset(): void;
|
|
235
235
|
/** Release all listeners. Idempotent; subsequent mutators throw. */
|
|
236
236
|
dispose(): void;
|
|
237
|
-
/**
|
|
237
|
+
/**
|
|
238
|
+
* Subscribe to state changes. Returns an unsubscribe.
|
|
239
|
+
* @remarks After `dispose()` this returns a no-op unsubscribe and registers no listener.
|
|
240
|
+
*/
|
|
238
241
|
onStateChange(handler: StateChangeHandler, options?: ListenerOptions): Unsubscribe;
|
|
239
|
-
/**
|
|
242
|
+
/**
|
|
243
|
+
* Subscribe to non-looping clip completions. Returns an unsubscribe.
|
|
244
|
+
* @remarks After `dispose()` this returns a no-op unsubscribe and registers no listener.
|
|
245
|
+
*/
|
|
240
246
|
onComplete(handler: CompleteHandler, options?: ListenerOptions): Unsubscribe;
|
|
241
247
|
/** Current state name. */
|
|
242
248
|
readonly activeState: string;
|
|
@@ -234,9 +234,15 @@ interface SpriteAnimator {
|
|
|
234
234
|
reset(): void;
|
|
235
235
|
/** Release all listeners. Idempotent; subsequent mutators throw. */
|
|
236
236
|
dispose(): void;
|
|
237
|
-
/**
|
|
237
|
+
/**
|
|
238
|
+
* Subscribe to state changes. Returns an unsubscribe.
|
|
239
|
+
* @remarks After `dispose()` this returns a no-op unsubscribe and registers no listener.
|
|
240
|
+
*/
|
|
238
241
|
onStateChange(handler: StateChangeHandler, options?: ListenerOptions): Unsubscribe;
|
|
239
|
-
/**
|
|
242
|
+
/**
|
|
243
|
+
* Subscribe to non-looping clip completions. Returns an unsubscribe.
|
|
244
|
+
* @remarks After `dispose()` this returns a no-op unsubscribe and registers no listener.
|
|
245
|
+
*/
|
|
240
246
|
onComplete(handler: CompleteHandler, options?: ListenerOptions): Unsubscribe;
|
|
241
247
|
/** Current state name. */
|
|
242
248
|
readonly activeState: string;
|
package/llms-full.txt
CHANGED
|
@@ -40,7 +40,7 @@ inputs ─▶ [transition graph] ─▶ active state ─▶ (Δt) ─▶ active
|
|
|
40
40
|
|
|
41
41
|
- **Inputs** — `Number` (continuous, e.g. `speed`), `Boolean` (toggle, e.g. `isGrounded`), `Trigger` (one-shot; auto-resets after a transition consumes it, e.g. `jump` / `attack`).
|
|
42
42
|
- **States** — an animation key (into the atlas `animations`) + loop / on-end behaviour + optional speed multiplier.
|
|
43
|
-
- **Transitions** — from a state (or **Any State**) to another when conditions over inputs hold (`Equals` / `NotEquals` / `GreaterThan` / `LessThan`). The highest-priority satisfied transition wins.
|
|
43
|
+
- **Transitions** — from a state (or **Any State**) to another when conditions over inputs hold (`Equals` / `NotEquals` / `GreaterThan` / `LessThan` / `Trigger`). The highest-priority satisfied transition wins.
|
|
44
44
|
- **`update(dt)`** — advances the playback timer; evaluates transitions (switching state, firing `onStateChange`, consuming triggers); computes the current frame from the animation's per-frame durations + loop; fires `onComplete` when a non-looping clip ends.
|
|
45
45
|
|
|
46
46
|
## Quick start — core (zero-dep)
|
|
@@ -213,7 +213,7 @@ pnpm example:platformer
|
|
|
213
213
|
|
|
214
214
|
## Status
|
|
215
215
|
|
|
216
|
-
**v0.1.
|
|
216
|
+
**v0.1.1 — OIDC/SLSA publish.** The npm tarball now carries SLSA build provenance (OIDC trusted-publisher pipeline). No source or API changes from v0.1.0, which shipped all roadmap modules (1–4): the renderer-agnostic core (`.`), the PixiJS v8 adapter (`aispritejs/pixi`), the atlas parser (`aispritejs/atlas`), and the JSON Schema (`aispritejs/schema`). See [CHANGELOG.md](CHANGELOG.md) for the full history. Zero runtime dependencies; the root import graph contains no `pixi.js`; `pixi.js` is an optional, type-only peer used only by the `/pixi` subpath.
|
|
217
217
|
|
|
218
218
|
## Roadmap
|
|
219
219
|
|
|
@@ -236,6 +236,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
236
236
|
|
|
237
237
|
## [Unreleased]
|
|
238
238
|
|
|
239
|
+
## [0.1.2] - 2026-06-05
|
|
240
|
+
|
|
241
|
+
### Changed
|
|
242
|
+
|
|
243
|
+
- JSON Schema: `animations` now requires at least one entry (`minProperties: 1`), matching `states`
|
|
244
|
+
and the runtime (which already rejects an empty animations map via `InvalidGraphError`).
|
|
245
|
+
|
|
246
|
+
### Fixed
|
|
247
|
+
|
|
248
|
+
- Reject non-finite (`Infinity`/`NaN`) `speed`, `duration`, and `defaultFrameDuration` at compile
|
|
249
|
+
time (`InvalidGraphError`); clamp non-finite `dt` to 0 in `update()` — previously these silently
|
|
250
|
+
corrupted looping playback (frame stuck at 0 / `NaN` accumulation).
|
|
251
|
+
|
|
239
252
|
## [0.1.1] - 2026-06-03
|
|
240
253
|
|
|
241
254
|
First release published through the OIDC `publish.yml` pipeline (npm trusted
|
package/llms.txt
CHANGED
|
@@ -12,7 +12,7 @@ Key guarantees: deterministic `update(dt)` (identical inputs + Δt ⇒ identical
|
|
|
12
12
|
- [README_ZHTW.md](README_ZHTW.md): Traditional Chinese mirror of the canonical README.
|
|
13
13
|
- [ROADMAP.md](ROADMAP.md): phased plan (v0.1.0 core → v0.2.0 PixiJS adapter → v0.3.0 atlas parser + JSON Schema → 1.0 freeze) and design invariants.
|
|
14
14
|
- [STABILITY.md](STABILITY.md): stability tier of every public symbol plus the pinned behavioural contract.
|
|
15
|
-
- [CHANGELOG.md](CHANGELOG.md): Keep a Changelog format; the 0.1.0 entry covers the core surface and CI guarantees.
|
|
15
|
+
- [CHANGELOG.md](CHANGELOG.md): Keep a Changelog format; the 0.1.1 entry notes SLSA build provenance (OIDC publish); the 0.1.0 entry covers the full core surface and CI guarantees.
|
|
16
16
|
- [CONTRIBUTING.md](CONTRIBUTING.md): quick-start commands, design principles, commit & PR style.
|
|
17
17
|
- [llms-full.txt](llms-full.txt): README + CHANGELOG + CONTRIBUTING + examples index concatenated into one file — load this when an AI agent needs the full context in a single fetch.
|
|
18
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aispritejs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Input-driven, renderer-agnostic 2D sprite animation runtime — a tiny, Rive-like visual state machine driven by Number / Boolean / Trigger inputs. JSON transition graph, deterministic update(dt), zero runtime dependencies. Browser / Node / Bun / Deno / WebView / Worker friendly.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sprite",
|
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
"type": "object"
|
|
12
12
|
},
|
|
13
13
|
"animations": {
|
|
14
|
-
"description": "Animation name -> ordered list of frame keys (each non-empty).",
|
|
14
|
+
"description": "Animation name -> ordered list of frame keys (each non-empty). Must declare at least one animation.",
|
|
15
15
|
"type": "object",
|
|
16
|
+
"minProperties": 1,
|
|
16
17
|
"additionalProperties": {
|
|
17
18
|
"type": "array",
|
|
18
19
|
"items": { "type": "string" },
|