@glissade/scene 0.18.0 → 0.19.0-pre.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/dist/describe.js +6 -2
- package/dist/index.d.ts +13 -0
- package/dist/index.js +10 -4
- package/package.json +2 -2
package/dist/describe.js
CHANGED
|
@@ -22,7 +22,7 @@ import { easings, listValueTypes } from "@glissade/core";
|
|
|
22
22
|
* never pulled onto the base embed path — a scene that never calls `describe()`
|
|
23
23
|
* pays zero bytes for it.
|
|
24
24
|
*/
|
|
25
|
-
const RAW_VERSION = "0.
|
|
25
|
+
const RAW_VERSION = "0.19.0-pre.0";
|
|
26
26
|
const PACKAGE_VERSION = RAW_VERSION.includes("GLISSADE_".concat("VERSION")) ? "0.0.0-dev" : RAW_VERSION;
|
|
27
27
|
/** Arity of a value type's numeric repr: vec2/vec2-arc → 2, number → 1; others (color/paint/path/string/boolean) carry no scalar arity. */
|
|
28
28
|
function arityOf(type) {
|
|
@@ -205,7 +205,11 @@ const BUILDER_METHODS = [
|
|
|
205
205
|
},
|
|
206
206
|
{
|
|
207
207
|
name: "stagger",
|
|
208
|
-
signature: "stagger<T>(targets, { to, from
|
|
208
|
+
signature: "stagger<T>(targets, { to: T | ((index, count) => T), from?: T | ((index, count) => T), duration?, ease? }, { each: number | ((rank, count) => number), anchor?, at? }): TimelineBuilder"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: "tracks",
|
|
212
|
+
signature: "tracks(tracks: Track[]): TimelineBuilder"
|
|
209
213
|
},
|
|
210
214
|
{
|
|
211
215
|
name: "set",
|
package/dist/index.d.ts
CHANGED
|
@@ -457,6 +457,19 @@ declare function bindScene(scene: Scene, doc: Timeline): BindingCacheEntry;
|
|
|
457
457
|
* caller's precondition.
|
|
458
458
|
*/
|
|
459
459
|
declare function evaluate(scene: Scene, doc: Timeline, t: number): DisplayList;
|
|
460
|
+
/**
|
|
461
|
+
* Controlled / imperative drive (0.19): `evaluate(scene)` with NO timeline —
|
|
462
|
+
* the host owns the clock. It evaluates against an EMPTY timeline at the
|
|
463
|
+
* scene's current playhead value (`peek()`, 0 by default), so values set
|
|
464
|
+
* imperatively via `node.set(...)` between frames survive into the DisplayList
|
|
465
|
+
* (no track clobbers them). See docs/controlled-drive.md for the loop and the
|
|
466
|
+
* `.set()`-vs-timeline precedence contract.
|
|
467
|
+
*
|
|
468
|
+
* PRECEDENCE: a timeline track ALWAYS overrides `.set()` on the prop it
|
|
469
|
+
* targets while that track is live — pass the timeline through the 3-arg form
|
|
470
|
+
* for animated props; reserve this overload for host-owned props.
|
|
471
|
+
*/
|
|
472
|
+
declare function evaluate(scene: Scene): DisplayList;
|
|
460
473
|
//#endregion
|
|
461
474
|
//#region src/cacheColdAudit.d.ts
|
|
462
475
|
interface CacheColdResult {
|
package/dist/index.js
CHANGED
|
@@ -602,11 +602,17 @@ function bindScene(scene, doc) {
|
|
|
602
602
|
return entry;
|
|
603
603
|
}
|
|
604
604
|
/**
|
|
605
|
-
*
|
|
606
|
-
*
|
|
607
|
-
*
|
|
605
|
+
* Empty timeline — zero tracks, so binding installs ZERO computed sources and
|
|
606
|
+
* any imperative `node.set(...)` value survives evaluate untouched. Shared and
|
|
607
|
+
* frozen so the WeakMap binding cache keys on a single stable document across
|
|
608
|
+
* the whole controlled-drive loop (one bind, reused every frame).
|
|
608
609
|
*/
|
|
609
|
-
|
|
610
|
+
const EMPTY_TIMELINE = Object.freeze({
|
|
611
|
+
version: 1,
|
|
612
|
+
tracks: []
|
|
613
|
+
});
|
|
614
|
+
function evaluate(scene, doc, t = 0) {
|
|
615
|
+
if (doc === void 0) return evaluate(scene, EMPTY_TIMELINE, scene.playhead.peek());
|
|
610
616
|
bindScene(scene, doc);
|
|
611
617
|
const fps = doc.fps;
|
|
612
618
|
const ctx = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glissade/scene",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0-pre.0",
|
|
4
4
|
"description": "glissade scene graph: nodes, transforms, DisplayList emission. Renderer-agnostic; zero DOM/Node dependencies.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"engines": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"yoga-layout": "^3.2.1",
|
|
34
|
-
"@glissade/core": "0.
|
|
34
|
+
"@glissade/core": "0.19.0-pre.0"
|
|
35
35
|
},
|
|
36
36
|
"repository": {
|
|
37
37
|
"type": "git",
|