@glissade/scene 0.18.0 → 0.19.0-pre.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.
- package/dist/describe.js +6 -2
- package/dist/index.d.ts +16 -2
- package/dist/index.js +10 -4
- package/dist/layout.d.ts +2 -1
- package/dist/layoutEngine.d.ts +1 -668
- package/dist/nodes.d.ts +722 -0
- package/dist/nodes.js +76 -2
- package/dist/type.d.ts +63 -0
- package/dist/type.js +120 -0
- package/package.json +6 -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.1";
|
|
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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { C as Mat2x3, D as matEquals, E as invert, O as multiply, S as IDENTITY, T as fromTRS, _ as StrokeStyle, a as FilterSpec, b as glow, c as MeshInterpolation, d as Paint, f as PathSeg, g as ShaderRef, h as ResourceId, i as DrawCommand, l as MeshPaint, m as Resource, n as DisplayList, o as FilterValidationError, p as Rect$1, r as DisplayListBuilder, s as FontSpec, t as BlendMode, u as MeshPoint, v as createDisplayListBuilder, w as applyToPoint, x as validateFilters, y as filtersToCanvasFilter } from "./displayList.js";
|
|
2
|
-
import {
|
|
2
|
+
import { A as resolveSketch, B as NodeProps, C as Polyline, D as arcLength, E as SketchValidationError, F as AnchorSpec, G as TextMetricsLite, H as resolveAnchor, I as BindablePropTarget, J as quantize, K as breakLines, L as EvalContext, M as sketchStrokes, N as validateHachure, O as flatten, P as validateSketch, R as HitArea, S as HachureSpec, T as SketchStyle, U as MEASURE_QUANTUM_PX, V as PropInit, W as TextMeasurer, X as segmentWords, Y as segmentGraphemes, Z as setDefaultMeasurer, _ as WordBox, a as ImageNode, b as revealSchedule, c as Path, d as RevealMark, f as ShapeProps, g as VideoProps, h as Video, i as Group, j as roughen, k as hachureLines, l as PathProps, m as TextProps, n as Custom, o as ImageProps, p as Text, q as estimatingMeasurer, r as GraphemeBox, s as LineBox, t as Circle, u as Rect, v as coercePathData, w as ResolvedSketch, x as roundedRectSegs, y as pathFromSegs, z as Node } from "./nodes.js";
|
|
3
|
+
import { a as LayoutEngineMissingError, c as requireLayoutEngine, i as LayoutEngine, l as setLayoutEngine, n as LayoutChildSpec, r as LayoutContainerSpec, s as getLayoutEngine, t as LayoutBox } from "./layoutEngine.js";
|
|
3
4
|
import { BindableSignal, BoundTimeline, CompiledTimeline, CoverageReport, EaseSpec, FontMode, FontUsage, MeshPaint as MeshPaint$1, PathValue, Playhead, Rng, Timeline, Track, Vec2 } from "@glissade/core";
|
|
4
5
|
import { ChannelOverride, Clip } from "@glissade/core/clips";
|
|
5
6
|
|
|
@@ -457,6 +458,19 @@ declare function bindScene(scene: Scene, doc: Timeline): BindingCacheEntry;
|
|
|
457
458
|
* caller's precondition.
|
|
458
459
|
*/
|
|
459
460
|
declare function evaluate(scene: Scene, doc: Timeline, t: number): DisplayList;
|
|
461
|
+
/**
|
|
462
|
+
* Controlled / imperative drive (0.19): `evaluate(scene)` with NO timeline —
|
|
463
|
+
* the host owns the clock. It evaluates against an EMPTY timeline at the
|
|
464
|
+
* scene's current playhead value (`peek()`, 0 by default), so values set
|
|
465
|
+
* imperatively via `node.set(...)` between frames survive into the DisplayList
|
|
466
|
+
* (no track clobbers them). See docs/controlled-drive.md for the loop and the
|
|
467
|
+
* `.set()`-vs-timeline precedence contract.
|
|
468
|
+
*
|
|
469
|
+
* PRECEDENCE: a timeline track ALWAYS overrides `.set()` on the prop it
|
|
470
|
+
* targets while that track is live — pass the timeline through the 3-arg form
|
|
471
|
+
* for animated props; reserve this overload for host-owned props.
|
|
472
|
+
*/
|
|
473
|
+
declare function evaluate(scene: Scene): DisplayList;
|
|
460
474
|
//#endregion
|
|
461
475
|
//#region src/cacheColdAudit.d.ts
|
|
462
476
|
interface CacheColdResult {
|
|
@@ -893,4 +907,4 @@ declare function meshRasterSize(bw: number, bh: number): {
|
|
|
893
907
|
h: number;
|
|
894
908
|
};
|
|
895
909
|
//#endregion
|
|
896
|
-
export { ALL_FILTER_KINDS, type AnchorSpec, type BackendCaps, type BindablePropTarget, type BlendMode, type CacheColdResult, type CanvasLike, Circle, ColdAssetError, type CommandDelta, type Ctx2DLike, Custom, DL_SNAPSHOT_VERSION, DeterminismViolationError, type DisplayDiff, type DisplayList, type DisplayListBuilder, type DlSnapshot, DlSnapshotError, type DrawCommand, type DrawOnEachOptions, type DrawOnOptions, DuplicateNodeIdError, type EachBox, type EachContext, type EachDistribute, EachError, type EachLayout, type EachMotion, type EachOpts, type EachResult, type EditMark, type EvalContext, type FieldChange, type FilterKind, type FilterSpec, FilterValidationError, FollowPath, type FollowPathProps, type FontByteLoader, type FontSpec, Group, type GuardMode, type HachureSpec, Highlight, type HighlightProps, type HitArea, IDENTITY, ImageNode as Image, ImageNode, type ImageDataLike, type ImageHandle, type ImageProps, type LayoutBox, type LayoutChildSpec, type LayoutContainerSpec, type LayoutEngine, LayoutEngineMissingError, type LineBox, MEASURE_QUANTUM_PX, MESH_DOWNSCALE, MESH_SHEPARD_POWER, MESH_SIGMA, type Mat2x3, type MeshInterpolation, type MeshPaint, type MeshPoint, NODE_TAXONOMY, Node, type NodeProps, type NodeTypeName, type Paint, Path, type PathLike, type PathProps, type PathSampler, type PathSeg, type Place, type Polyline, type PropInit, Raster2D, type Raster2DHost, Rect, type Rect$1 as RectShape, type RenderBackend, ReservedNodeIdError, type ResolvedSketch, type Resource, type ResourceId, type RevealMark, type Scene, type SceneInit, type SceneModule, type ShaderCaps, ShaderEffect, type ShaderEffectProps, type ShaderRef, type ShapeProps, type SketchStyle, SketchValidationError, type StepMark, type StrokeStyle, Text, TextCursor, type TextCursorProps, type TextMeasurer, type TextMetricsLite, type TextProps, TokenHighlight, type TokenHighlightProps, TokenMatchError, type TokenRange, type TypeEdit, type TypewriterResult, type ValidateSceneFontsOptions, Video, type VideoFrameSource, type VideoProps, type WordBox, applyToPoint, arcLength, auditCacheCold, bindScene, breakLines, coercePathData, collapseReplacer, collectLocalizedTextUsages, collectTextUsages, createDisplayListBuilder, createScene, diffDisplayLists, drawOn, drawOnEach, each, estimatingMeasurer, evaluate, filtersToCanvasFilter, flatten, followPath, fontString, formatDisplayDiff, fromTRS, getLayoutEngine, glow, hachureLines, highlight, invert, matEquals, matchTokenRun, meshRasterSize, motionPath, multiply, parseDisplaySnapshot, pathFromSegs, pathLength, pointAtLength, quantize, rasterizeMesh, requireLayoutEngine, resolveAnchor, resolveSketch, revealSchedule, roughen, roundedRectSegs, segmentGraphemes, segmentWords, serializeDisplayList, setDefaultMeasurer, setLayoutEngine, sketchStrokes, textCursor, tokenHighlight, typewriter, validateFilters, validateHachure, validateSceneFonts, validateSketch, withDeterminismGuards };
|
|
910
|
+
export { ALL_FILTER_KINDS, type AnchorSpec, type BackendCaps, type BindablePropTarget, type BlendMode, type CacheColdResult, type CanvasLike, Circle, ColdAssetError, type CommandDelta, type Ctx2DLike, Custom, DL_SNAPSHOT_VERSION, DeterminismViolationError, type DisplayDiff, type DisplayList, type DisplayListBuilder, type DlSnapshot, DlSnapshotError, type DrawCommand, type DrawOnEachOptions, type DrawOnOptions, DuplicateNodeIdError, type EachBox, type EachContext, type EachDistribute, EachError, type EachLayout, type EachMotion, type EachOpts, type EachResult, type EditMark, type EvalContext, type FieldChange, type FilterKind, type FilterSpec, FilterValidationError, FollowPath, type FollowPathProps, type FontByteLoader, type FontSpec, type GraphemeBox, Group, type GuardMode, type HachureSpec, Highlight, type HighlightProps, type HitArea, IDENTITY, ImageNode as Image, ImageNode, type ImageDataLike, type ImageHandle, type ImageProps, type LayoutBox, type LayoutChildSpec, type LayoutContainerSpec, type LayoutEngine, LayoutEngineMissingError, type LineBox, MEASURE_QUANTUM_PX, MESH_DOWNSCALE, MESH_SHEPARD_POWER, MESH_SIGMA, type Mat2x3, type MeshInterpolation, type MeshPaint, type MeshPoint, NODE_TAXONOMY, Node, type NodeProps, type NodeTypeName, type Paint, Path, type PathLike, type PathProps, type PathSampler, type PathSeg, type Place, type Polyline, type PropInit, Raster2D, type Raster2DHost, Rect, type Rect$1 as RectShape, type RenderBackend, ReservedNodeIdError, type ResolvedSketch, type Resource, type ResourceId, type RevealMark, type Scene, type SceneInit, type SceneModule, type ShaderCaps, ShaderEffect, type ShaderEffectProps, type ShaderRef, type ShapeProps, type SketchStyle, SketchValidationError, type StepMark, type StrokeStyle, Text, TextCursor, type TextCursorProps, type TextMeasurer, type TextMetricsLite, type TextProps, TokenHighlight, type TokenHighlightProps, TokenMatchError, type TokenRange, type TypeEdit, type TypewriterResult, type ValidateSceneFontsOptions, Video, type VideoFrameSource, type VideoProps, type WordBox, applyToPoint, arcLength, auditCacheCold, bindScene, breakLines, coercePathData, collapseReplacer, collectLocalizedTextUsages, collectTextUsages, createDisplayListBuilder, createScene, diffDisplayLists, drawOn, drawOnEach, each, estimatingMeasurer, evaluate, filtersToCanvasFilter, flatten, followPath, fontString, formatDisplayDiff, fromTRS, getLayoutEngine, glow, hachureLines, highlight, invert, matEquals, matchTokenRun, meshRasterSize, motionPath, multiply, parseDisplaySnapshot, pathFromSegs, pathLength, pointAtLength, quantize, rasterizeMesh, requireLayoutEngine, resolveAnchor, resolveSketch, revealSchedule, roughen, roundedRectSegs, segmentGraphemes, segmentWords, serializeDisplayList, setDefaultMeasurer, setLayoutEngine, sketchStrokes, textCursor, tokenHighlight, typewriter, validateFilters, validateHachure, validateSceneFonts, validateSketch, withDeterminismGuards };
|
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/dist/layout.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { r as DisplayListBuilder } from "./displayList.js";
|
|
2
|
-
import {
|
|
2
|
+
import { B as NodeProps, L as EvalContext, V as PropInit, W as TextMeasurer, i as Group, z as Node } from "./nodes.js";
|
|
3
|
+
import { a as LayoutEngineMissingError, i as LayoutEngine, l as setLayoutEngine, n as LayoutChildSpec, o as LayoutResult, r as LayoutContainerSpec, s as getLayoutEngine, t as LayoutBox } from "./layoutEngine.js";
|
|
3
4
|
import { BindableSignal } from "@glissade/core";
|
|
4
5
|
|
|
5
6
|
//#region src/layout.d.ts
|