@nika-js/onlymap 0.6.20 → 0.6.21

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/{LercDecode.es-DiDn51b8.js → LercDecode.es-B_dD2_mY.js} +1 -1
  4. package/dist/actions.d.ts +94 -1
  5. package/dist/attribute-resolution.d.ts +12 -0
  6. package/dist/{basemap-Bvtudw-w.js → basemap-DK0AJ6ZH.js} +2 -2
  7. package/dist/declarative-filter.d.ts +2 -16
  8. package/dist/effect-track.d.ts +94 -0
  9. package/dist/effects.d.ts +2 -0
  10. package/dist/elements/om-map.d.ts +9 -8
  11. package/dist/elements/om-story.d.ts +18 -0
  12. package/dist/{geoparquet-DFfq6-JJ.js → geoparquet-fc2daxMh.js} +1 -1
  13. package/dist/{index-AlG5NjjQ.js → index-9EEyGbU1.js} +1 -1
  14. package/dist/{index-Cq0qmoDj.js → index-BNZFF535.js} +2 -2
  15. package/dist/{index-ZDGLuUoq.js → index-BwoceNAo.js} +1 -1
  16. package/dist/{index-CPthQWzC.js → index-CuBGRyG-.js} +13613 -13340
  17. package/dist/{index-DIHnIeho.js → index-DOPjev5l.js} +1 -1
  18. package/dist/internal-ids.d.ts +2 -0
  19. package/dist/{lerc-C3kqqJ1B.js → lerc-CMJO8KZO.js} +2 -2
  20. package/dist/onlymap.standalone.js +23487 -23214
  21. package/dist/onlymapjs.js +1 -1
  22. package/dist/programmatic.d.ts +1 -2
  23. package/dist/{raster-6tndfpHv.js → raster-GMsuQARC.js} +2 -2
  24. package/dist/{raster-pipeline-DVLch-nI.js → raster-pipeline-DNpKXgO3.js} +1 -1
  25. package/dist/runtime-core.d.ts +22 -0
  26. package/dist/snapshot.d.ts +15 -0
  27. package/dist/version.d.ts +1 -1
  28. package/dist/{zarr-D5UCDgG7.js → zarr-KiXluGoJ.js} +2 -2
  29. package/docs/stories.md +2 -0
  30. package/llms.txt +2 -2
  31. package/package.json +1 -1
  32. package/skills/onlymapjs/SKILL.md +1 -1
  33. package/skills/onlymapjs/references/syntax.md +3 -3
package/CHANGELOG.md CHANGED
@@ -8,6 +8,18 @@ Note: npm collapsed a few closely-spaced releases — the GPX/FlatGeobuf (0.5.4)
8
8
  and GeoParquet (0.5.5) work shipped to npm together as **0.5.6**, so npm's
9
9
  version list jumps 0.5.3 → 0.5.6. Each logical version is listed here regardless.
10
10
 
11
+ ## 0.6.21 — 2026-08-26
12
+
13
+ ### Added
14
+ - **Recordings now capture animations, not just end states.** Fade, pulse, trace, and populate steps animate frame-accurately in `onlymapjs record` output and paced story runs — a 2-second border trace draws itself on across 2 seconds of video instead of appearing fully drawn. Seeking a story under the recording switch lands mid-animation too (a half-drawn trace is just a scene), which external frame renderers rely on. One documented limit: the `trace follow` camera is skipped during recorded runs, since the paced route drives the camera.
15
+
16
+ ### Fixed
17
+ - **On-map labels (`anchor="surface"`) now sit on the landmass they belong to.** Ring selection previously favored densely-digitized slivers and could even pick a hole; features without a usable anchor point no longer draw a stray label at null island.
18
+ - **The `trace follow` camera stays glued to the drawing tip.** It previously sampled the path by distance while the ink advanced by timestamps, so routes with dwells or slow legs pulled the camera away from the head; layers with several separately-timed paths no longer make the camera jump between them.
19
+ - **Blob-format snapshots are byte-stable again.** Stability comparison silently never matched for blob output, so exactly the format video renderers request lost its guarantee.
20
+ - **Seeking a story no longer overwrites fit-bounds or zoom-to poses between camera legs.**
21
+ - **Paid-license render exemption is scoped to real local browser pages** — it no longer applies in environments without a page location at all.
22
+
11
23
  ## 0.6.20 — 2026-08-26
12
24
 
13
25
  ### Fixed
package/README.md CHANGED
@@ -147,7 +147,7 @@ Built-in actions wire to picks, widget buttons (`data-emit`), or script (`ctx.em
147
147
 
148
148
  **Animation:** camera moves accept a duration — `map.flyTo(coords, zoom, { duration: 1200, curve: true })`, or the `fly-to` action (`center`/`zoom`/`pitch`/`bearing`/`duration`) from any behavior or button; `prefers-reduced-motion` is honored (moves become instant, final state identical). Per-prop GPU transitions via the `transition` attribute: `transition="get-fill-color 800ms"` fades color changes; on a streaming layer, `transition="get-position 300ms"` makes entities glide between updates.
149
149
 
150
- **Map stories:** a guided tour as markup — `<om-story>` holds `<om-step>` children that fire the same actions behaviors use, on a timeline (`duration`, `delay`, `parallel`); the built-in `type="player"` widget gives play/pause/scrub, seeking restores the scene's captured initial state, one story is active per map, and grabbing the map pauses playback. Effect verbs — `fade`, `pulse`, `trace` (progressive TripsLayer draw-on; with `feature-id`, a single polygon draws itself on inside its own layer), and `populate` (rows drop in one by one via a GPU filter sweep) — work as step shorthands or plain actions. The story is a sibling that references layers by id — delete it and the map is unchanged. For flybys over 3D tilesets, `warm-tiles` pre-loads the route's tiles in the background before playback, and `paced` goes further: the story steps its own clock and never advances a frame while a tileset is still refining, so no frame ever shows unrefined tiles — wall-clock stretches instead (built for recorded takes; emits `om-paced-tick {t, waitedMs}` per frame, and the two compose — warm first, wait less). `npx @nika-js/onlymap record map.html --out flyby.mp4` turns that guarantee into an actual video: one screenshot per paced frame in headless Chromium (widgets and attribution included), assembled with ffmpeg. Guide: [docs/stories.md](docs/stories.md).
150
+ **Map stories:** a guided tour as markup — `<om-story>` holds `<om-step>` children that fire the same actions behaviors use, on a timeline (`duration`, `delay`, `parallel`); the built-in `type="player"` widget gives play/pause/scrub, seeking restores the scene's captured initial state, one story is active per map, and grabbing the map pauses playback. Effect verbs — `fade`, `pulse`, `trace` (progressive TripsLayer draw-on; with `feature-id`, a single polygon draws itself on inside its own layer), and `populate` (rows drop in one by one via a GPU filter sweep) — work as step shorthands or plain actions. The story is a sibling that references layers by id — delete it and the map is unchanged. For flybys over 3D tilesets, `warm-tiles` pre-loads the route's tiles in the background before playback, and `paced` goes further: the story steps its own clock and never advances a frame while a tileset is still refining, so no frame ever shows unrefined tiles — wall-clock stretches instead (built for recorded takes; emits `om-paced-tick {t, waitedMs}` per frame, and the two compose — warm first, wait less). `npx @nika-js/onlymap record map.html --out flyby.mp4` turns that guarantee into an actual video: one screenshot per paced frame in headless Chromium (widgets and attribution included), assembled with ffmpeg — and effect verbs animate on the story clock, so recorded traces draw on frame by frame exactly as authored. Guide: [docs/stories.md](docs/stories.md).
151
151
 
152
152
  **Classified symbology:** `classify-by="magnitude" classify-scale="jenks" classify-classes="5" classify-ramp="viridis"` computes class breaks *from the data* (quantile, equal-interval, or Jenks natural breaks), styles the layer with a named ramp, and auto-generates the classes legend — no domains or colors to hand-author; an explicit `get-fill-color`/`color` always wins. **Temporal playback:** `<om-widget type="time-slider" layer="…" field="time" duration="20s" window="86400000" format="date">` is a play/pause/scrub control over a layer's time field, driving the same `filter-layer` mechanics as the filter widget (stats stay coherent; `loop` restarts the sweep).
153
153
 
@@ -19,7 +19,7 @@ async function v(N = {}) {
19
19
  if (n) {
20
20
  const { createRequire: I } = await import(
21
21
  /*webpackIgnore:true*/
22
- "./lerc-C3kqqJ1B.js"
22
+ "./lerc-CMJO8KZO.js"
23
23
  ).then((g) => g._);
24
24
  var O = I(import.meta.url);
25
25
  }
package/dist/actions.d.ts CHANGED
@@ -1,3 +1,13 @@
1
+ /**
2
+ * The action registry (spec: "Module Breakdown / Behavior Engine" — "Action
3
+ * payload contract"). One event name maps to one action handler with one
4
+ * payload schema, honored identically across all three emit surfaces —
5
+ * `ctx.emit(name, payload)`, `data-emit`, and `<om-behavior>` — an action
6
+ * reads the same keys regardless of how it was triggered. `registerAction`
7
+ * is re-exported from the package entry point (index.ts) as the public
8
+ * `OmMap.registerAction` surface.
9
+ */
10
+ import { TRACE_TEMP_PREFIX } from "./internal-ids";
1
11
  import type { RuntimeCore } from "./runtime-core";
2
12
  import type { LayerIR } from "./ir";
3
13
  export type ActionHandler = (payload: Record<string, unknown>, mapEl: Element, core: RuntimeCore, layerIRs: ReadonlyMap<string, LayerIR>) => void;
@@ -9,6 +19,16 @@ export declare function dispatchAction(name: string, payload: Record<string, unk
9
19
  export { RUNTIME_INTERNAL_PREFIX } from "./internal-ids";
10
20
  /** The overlay anchor for a feature: its bbox center for geojson geometry, else its point (flat lon/lat). */
11
21
  export declare function featureAnchorPoint(feature: unknown): [number, number] | undefined;
22
+ /**
23
+ * Animated-camera payload coercion (spec: "Map Stories / Animation
24
+ * primitives"). Payloads arrive as strings from behavior/step attributes
25
+ * and data-emit, as real values from ctx.emit — coerce both. Durations
26
+ * accept "800", "800ms", or "2s".
27
+ */
28
+ export declare function cameraOpts(payload: Record<string, unknown>): {
29
+ duration: number;
30
+ curve: boolean;
31
+ };
12
32
  /**
13
33
  * `trace` — progressive draw. Real tracing needs per-vertex time, which is
14
34
  * TripsLayer's whole purpose: sweep `currentTime` across the data's
@@ -16,6 +36,79 @@ export declare function featureAnchorPoint(feature: unknown): [number, number] |
16
36
  * back to `fade` with a warning (deck.gl has no dash-offset to fake a
17
37
  * draw-on with — documented in the spec).
18
38
  */
19
- export declare const TRACE_TEMP_PREFIX = "__onlymapjs-trace-";
39
+ export { TRACE_TEMP_PREFIX };
40
+ export declare function tracedHiddenSet(core: RuntimeCore, layerId: string): Set<string>;
41
+ /** Re-derive the source layer's `data` hide from the current hidden set: nothing hidden clears the hide, else data = rows minus the union. Clears ONLY the data key — a concurrent effect's keys on the same layer (a story-time fade hold, a pulse) must survive the reveal. */
42
+ export declare function applyTraceHide(core: RuntimeCore, ir: LayerIR, rows: readonly unknown[]): void;
20
43
  /** Story scrub restore — drop all trace hide bookkeeping for this core (the channel props themselves are cleared separately by cancelAllLayerEffects). */
21
44
  export declare function resetTraceHides(core: RuntimeCore): void;
45
+ /**
46
+ * The temp outline layer both trace clocks build (wall-clock traceFeature,
47
+ * story-time EffectTrack): a real runtime-managed <om-layer type="TripsLayer">
48
+ * riding the normal parse → IR → reconcile pipeline.
49
+ */
50
+ export declare function buildTraceTempElement(mapEl: Element, tempId: string, outline: {
51
+ segments: unknown[];
52
+ total: number;
53
+ }, color: unknown): Element;
54
+ /** Fraction of a per-feature trace slot spent drawing; the rest reveals the real feature and dissolves the outline. */
55
+ export declare const TRACE_DRAW_FRACTION = 0.75;
56
+ /**
57
+ * Target resolution both trace clocks share — the two payload shapes
58
+ * (explicit `{ layer, featureId }`, or the pick-derived `{ feature }` a
59
+ * click behavior supplies; picked objects are FLATTENED by the selection
60
+ * path, so the pick only contributes an id and the real row is always
61
+ * looked up from the layer's own data), the row lookup, the outline, and
62
+ * the per-feature temp-layer id. Null = no traceable outline — callers
63
+ * fall back to fade.
64
+ */
65
+ export interface TraceTarget {
66
+ featureId: string;
67
+ rows: readonly unknown[];
68
+ outline: {
69
+ segments: unknown[];
70
+ total: number;
71
+ };
72
+ tempId: string;
73
+ /** Columnar data never hides (its rows carry no geometry, so the outline already failed there). */
74
+ canHide: boolean;
75
+ }
76
+ export declare function resolveTraceTarget(payload: Record<string, unknown>, ir: LayerIR): TraceTarget | null;
77
+ /**
78
+ * `populate` (spec: "Effect verbs") — rows drop in one by one, the
79
+ * "populate" effect. Rides the ALWAYS-MOUNTED DataFilterExtension (see
80
+ * attribute-resolution): each frame only moves the filterRange upper bound
81
+ * — a uniform update, zero re-upload, the extension's design purpose.
82
+ * Appearance order:
83
+ * - authored `filter-field`: the sweep runs over the AUTHORED range, so
84
+ * rows appear in filter-dimension order and the end state IS the
85
+ * authored filter — nothing to restore;
86
+ * - payload `field`: a one-shot getFilterValue buffer over that field;
87
+ * - neither: data order (ordinal index accessor).
88
+ * GeoJSON without an authored filter falls back to fade: a live composite
89
+ * does not forward a patched getFilterValue to its sub-layers (the
90
+ * per-feature-trace lesson).
91
+ */
92
+ /** Everything a populate sweep needs, computed once up front — `null` means "no sweepable dimension; fall back to fade" (both clocks share this). */
93
+ export interface PopulateSweep {
94
+ lo: number;
95
+ hi: number;
96
+ accessorPatch?: Record<string, unknown>;
97
+ /** Authored filter dimensions beyond the swept one — held fixed each frame (see the packed filterRange comment below). */
98
+ otherDimRanges?: [number, number][];
99
+ }
100
+ export declare function preparePopulateSweep(payload: Record<string, unknown>, ir: LayerIR): PopulateSweep | null;
101
+ /**
102
+ * The populate sweep's per-frame patch: the accessor patch (same references
103
+ * every frame — the buffer computes once, keyed by its trigger) plus the
104
+ * swept upper bound. With other authored dimensions present, `filterRange`
105
+ * must be the FULL packed array (deck.gl's own multi-dimension shape) — the
106
+ * swept dimension's range first, matching `ir.filter[0]`'s position, then
107
+ * the rest fixed at their authored ranges.
108
+ */
109
+ export declare function populateSweepFrame(sweep: PopulateSweep, t01: number): Record<string, unknown>;
110
+ /** Timestamp range of a TripsLayer's data via its own compiled getTimestamps accessor — the trace sweep's domain (shared by both trace clocks). */
111
+ export declare function tripsTimestampRange(ir: LayerIR): {
112
+ t0: number;
113
+ t1: number;
114
+ } | null;
@@ -206,6 +206,18 @@ export declare const FULL_JS_COLUMNAR_RULE: {
206
206
  };
207
207
  /** Coerce a raw attribute string to a primitive: bare/true/false, JSON array/object, number, or string. */
208
208
  export declare function coerceValue(raw: string, hint?: PropDescriptor["type"], attrName?: string): unknown;
209
+ /**
210
+ * Schema defaults must be assigned BY VALUE: several descriptors carry
211
+ * deck's own defaultProps objects (e.g. `extensions: []`), and assigning
212
+ * that array by reference aliases it across EVERY layer of the type — one
213
+ * layer's extension push then mutates deck's class default and leaks into
214
+ * all siblings (found via the atlas demo: a trace temp that verifiably
215
+ * skipped filter wiring still built with a DataFilterExtension, because the
216
+ * defaults pass handed it the type's shared, already-polluted array).
217
+ * Shallow clone is exactly right: entries (extension instances) may share,
218
+ * the CONTAINER must not.
219
+ */
220
+ export declare function cloneDefault(value: unknown): unknown;
209
221
  export interface ResolvedAttributes {
210
222
  props: Record<string, unknown>;
211
223
  meta: LayerMeta;
@@ -1,4 +1,4 @@
1
- import { C as ny, L as sy, M as oy, m as ay, c as ka, a as Sd, z as oc, G as sm, V as ly, W as cy, b as uy, g as hy, d as Vu, f as Ed, e as dy, l as py, u as fy, D as Qf, h as my } from "./index-CPthQWzC.js";
1
+ import { C as ny, L as sy, M as oy, m as ay, c as ka, a as Sd, z as oc, G as sm, V as ly, W as cy, b as uy, g as hy, d as Vu, f as Ed, e as dy, l as py, u as fy, D as Qf, h as my } from "./index-CuBGRyG-.js";
2
2
  const Cd = Math.PI / 180, gy = 180 / Math.PI;
3
3
  function em(Pe, J = 0) {
4
4
  const me = Math.min(180, Pe) * Cd;
@@ -25321,7 +25321,7 @@ class Ry {
25321
25321
  Me && me > 0 ? this.map.flyTo(Te) : this.map.easeTo(Te);
25322
25322
  }
25323
25323
  fitBounds(J, me, Me = 0) {
25324
- this.map.fitBounds(J, { padding: me, duration: Me });
25324
+ this.markBusy(), this.map.fitBounds(J, { padding: me, duration: Me });
25325
25325
  }
25326
25326
  destroy() {
25327
25327
  if (this.pendingCaptureRejects.size > 0) {
@@ -1,22 +1,8 @@
1
- /**
2
- * CPU-side mirror of the GPU `DataFilterExtension` test (spec: "Filter-aware
3
- * stats & data (the coherence rule)") — `ctx.stats`/`ctx.dataInViewport`
4
- * apply the SAME field+range/category test(s) by default, so a chart/stat
5
- * reflects what the map visibly shows. A row whose field isn't a finite
6
- * number (numeric) or isn't in the keep-list (categorical) is treated as
7
- * filtered-out, matching the GPU path. With more than one dimension of
8
- * EITHER kind a row passes only if every dimension's test passes (AND
9
- * across dimensions) — the same semantics deck.gl's own packed
10
- * `filterRange`/`filterCategories` arrays apply GPU-side. Numeric and
11
- * categorical are independent mechanisms (see `applyFilterWiring`'s doc
12
- * comment) but combine the same way: a row must pass BOTH kinds when both
13
- * are active on a layer.
14
- */
15
- import type { Shape, LayerFilter, LayerCategoryFilter } from "./ir";
1
+ import type { Shape, LayerFilter, LayerCategoryFilter, LayerData } from "./ir";
16
2
  export declare function applyDeclarativeFilter(rows: readonly unknown[], shape: Shape, filter: LayerFilter): unknown[];
17
3
  /** The same test as a reusable predicate — the columnar viewport filter runs it inside its index-aligned loop. */
18
4
  export declare function declarativeFilterPredicate(shape: Shape, filter: LayerFilter): (row: unknown) => boolean;
19
5
  export declare function applyDeclarativeCategoryFilter(rows: readonly unknown[], shape: Shape, categoryFilter: LayerCategoryFilter): unknown[];
20
6
  /** Categorical twin of `declarativeFilterPredicate` — set membership instead of a range test. */
21
7
  export declare function declarativeCategoryFilterPredicate(shape: Shape, categoryFilter: LayerCategoryFilter): (row: unknown) => boolean;
22
- export declare function warnCategoryCardinality(categoryFilter: LayerCategoryFilter | undefined, rows: readonly unknown[], shape: Shape, warnLabel: string): void;
8
+ export declare function warnCategoryCardinality(categoryFilter: LayerCategoryFilter | undefined, data: LayerData, shape: Shape, warnLabel: string): void;
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Story-time effect evaluation (spec: "Map Stories" / issue #37's pull
3
+ * model, completed for layer effects). `buildCameraLegs`/`cameraAtTime`
4
+ * already make the camera a pure function of story time; this module does
5
+ * the same for the animated verbs (fade / pulse / trace / populate). When
6
+ * the story owns the clock — a paced story (the recorder) or the
7
+ * determinism switch (frame renderers seeking) — those steps are NOT
8
+ * dispatched as actions: the story builds one EffectTrack from its timeline
9
+ * and evaluates every leg at the current story time on each tick or seek.
10
+ * A trace 40% drawn is then just a scene, reproducible at any t, instead
11
+ * of a wall-clock rAF loop racing the capture.
12
+ *
13
+ * Interactive wall-clock playback is untouched: it keeps dispatching the
14
+ * verbs through actions.ts, whose rAF path (effects.ts) remains the clock
15
+ * for anything without a timeline (click-to-trace behaviors, ctx.emit).
16
+ * Both clocks share the same underlying builders — the pure math
17
+ * (traceProgress, pulseOpacity, EASINGS), the populate sweep, the trace
18
+ * target/temp element — so a verb renders identically whichever clock
19
+ * drives it.
20
+ *
21
+ * Evaluation contract: legs are stateless functions of t, EXCEPT the
22
+ * documented enter/exit hooks (temp-layer DOM, trace hide sets), which the
23
+ * evaluator invokes on phase transitions. Seek resets are handled by the
24
+ * story's existing scrub model — restore-initial clears every channel patch
25
+ * and temp layer, then resetState() forgets all phases and applyAt(t)
26
+ * rebuilds the scene from pristine. Follow cameras are the one exception:
27
+ * during a paced run the driver owns the camera, so `follow` is skipped
28
+ * (warned once per track).
29
+ */
30
+ import type { RuntimeCore } from "./runtime-core";
31
+ import type { LayerIR } from "./ir";
32
+ import type { StepInterval } from "./timeline";
33
+ /** The verbs the track owns — fireDueSteps suppresses exactly these while the story clock drives effects. */
34
+ export declare const EFFECT_TRACK_ACTIONS: Set<string>;
35
+ export interface EffectTrackDeps {
36
+ core: RuntimeCore;
37
+ mapEl: Element;
38
+ /**
39
+ * LIVE accessor, never a snapshot: om-map REASSIGNS its IR map on every
40
+ * reconcile (`this.layerIRs = next`), so a captured reference goes stale
41
+ * after the first reconcile of a run — which is guaranteed (the trace
42
+ * leg's own temp-element append triggers one). Legs re-init when a
43
+ * layer's data identity changes (URL arrival), which only works read
44
+ * through here.
45
+ */
46
+ getLayerIRs(): ReadonlyMap<string, LayerIR>;
47
+ }
48
+ /** A leg's resolved behavior — chosen lazily on first need, when the layer's data is in hand. */
49
+ interface LegImpl {
50
+ /** Eased t01 → per-layer patches (the same shapes the wall-clock path writes through patchAnimatedProps). */
51
+ frame(t01: number): Record<string, Record<string, unknown>>;
52
+ /** "hold": past the leg, keep frame(1) applied. "clear": past the leg, the authored state IS the end state. */
53
+ end: "hold" | "clear";
54
+ /** Phase-entry hook (idempotent per activation): temp layers, trace hides. */
55
+ enter?(): void;
56
+ /** Phase-exit hook: teardown of whatever enter() built. */
57
+ exit?(): void;
58
+ }
59
+ interface Leg {
60
+ layerId: string;
61
+ start: number;
62
+ duration: number;
63
+ easing?: (t: number) => number;
64
+ init(deps: EffectTrackDeps): LegImpl | null;
65
+ }
66
+ export declare class EffectTrack {
67
+ private readonly legs;
68
+ private readonly deps;
69
+ private states;
70
+ /** Set by deactivate() (including ensureImpl's re-init teardown) — the heal pass re-applies what a removeEffectKeys may have stripped from a shared layer. */
71
+ private keysRemoved;
72
+ constructor(legs: Leg[], deps: EffectTrackDeps);
73
+ /** Forget all phase state WITHOUT teardown — call only after the story's restore-initial has already cleared patches and temp layers. */
74
+ resetState(): void;
75
+ /**
76
+ * Evaluate every leg at story time t. CONTRACT: t is monotonically
77
+ * non-decreasing between resetState() calls — every caller guarantees it
78
+ * (advanceBy is monotone; seek and the loop restart reset first), so
79
+ * phases only ever move forward here and no backward transition exists.
80
+ * Legs are pre-sorted by start, so cross-leg chains resolve in timeline
81
+ * order.
82
+ */
83
+ applyAt(t: number): void;
84
+ /** Re-applies leg i's current value: frame(1) for a settled hold, the eased frame at t for an active leg, nothing otherwise. Idempotent. */
85
+ private applyLegFrame;
86
+ private ensureImpl;
87
+ private apply;
88
+ private deactivate;
89
+ }
90
+ export declare function buildEffectTrack(steps: readonly {
91
+ action: string;
92
+ payload: Record<string, unknown>;
93
+ }[], intervals: readonly StepInterval[], deps: EffectTrackDeps): EffectTrack;
94
+ export {};
package/dist/effects.d.ts CHANGED
@@ -18,6 +18,8 @@ export declare const EASINGS: Record<string, (t: number) => number>;
18
18
  export declare function traceProgress(t01: number, t0: number, t1: number): number;
19
19
  /** Oscillates 1 → low → 1 per cycle (cosine), ending exactly at 1 for whole cycles. */
20
20
  export declare function pulseOpacity(t01: number, cycles: number, low?: number): number;
21
+ /** Removes exactly one effect's keys from the layer's channel entry, preserving keys other writers own. (Exported for the story-time EffectTrack, which manages its own written-key sets.) */
22
+ export declare function removeEffectKeys(core: RuntimeCore, layerId: string, keys: Set<string>): void;
21
23
  export declare function prefersReducedMotion(): boolean;
22
24
  export interface LayerEffect {
23
25
  /** t01 ∈ [0, 1] → the plain-prop patch for this frame. */
@@ -1,4 +1,5 @@
1
1
  import { HTMLElementBase } from "../env";
2
+ import { RuntimeCore } from "../runtime-core";
2
3
  import { type RuntimeContext } from "../ctx";
3
4
  import { type LightingIR } from "../scene-lighting";
4
5
  import { type ClipBoxIR } from "../clip-box";
@@ -54,7 +55,6 @@ export declare class OmMapElement extends HTMLElementBase {
54
55
  /** Dedup guard for the no-terrain-for-elevation error — same shape as `warnedApproximatePlacement`. */
55
56
  private erroredNoTerrainForElevation;
56
57
  private readyFired;
57
- private firstSettleDrawDone;
58
58
  /** Custom-state holder for the `om-collapsed` height-floor marker — see applyHeightFloor. */
59
59
  private internals;
60
60
  private resolveReady;
@@ -260,13 +260,8 @@ export declare class OmMapElement extends HTMLElementBase {
260
260
  * same path a real deck click/hover coordinate takes, so the om-map-point
261
261
  * event and custom capture tools are testable without a GPU. */
262
262
  /**
263
- * The map's "done drawing" promise (issue #37): resolves once every live
264
- * 3D tileset has refined for the CURRENT view and one further animation
265
- * frame has been painted — the await a pull-model frame renderer (or a
266
- * consumer Playwright test) needs before screenshotting. Resolves
267
- * `{settled:false}` with a console warning on timeout rather than
268
- * rejecting (a late frame is ordinary pop-in, not an error). v1 gates 3D
269
- * tilesets only — basemap raster tiles are not yet awaited.
263
+ * The map's "done drawing" promise (issue #37) delegates to
264
+ * RuntimeCore.whenSettled, the single owner of the settle contract.
270
265
  */
271
266
  whenSettled(opts?: {
272
267
  timeout?: number;
@@ -275,6 +270,12 @@ export declare class OmMapElement extends HTMLElementBase {
275
270
  }>;
276
271
  /** Test surface: is the determinism switch active on the core (issue #37 — must be true BEFORE the first render when data-om-recording is authored; the basemap adapter reads it in its constructor). */
277
272
  isDeterministicInternal(): boolean;
273
+ /** What the story-time EffectTrack needs to evaluate legs (om-story builds one when the story clock owns effects — paced stories, determinism). getLayerIRs is a LIVE accessor: reconcile REASSIGNS this.layerIRs, so a captured map reference would go stale after the first reconcile of a run. */
274
+ getEffectDepsInternal(): {
275
+ core: RuntimeCore;
276
+ mapEl: Element;
277
+ getLayerIRs(): ReadonlyMap<string, LayerIR>;
278
+ } | null;
278
279
  injectMapPointInternal(coordinate: [number, number] | null, kind?: "click" | "hover", pointerType?: string): void;
279
280
  /** Harness setView (spec: "Consumer Testing Surface") — the one path that reaches pitch/bearing. */
280
281
  setViewInternal(partial: {
@@ -15,6 +15,8 @@ export declare class OmStoryElement extends HTMLElementBase {
15
15
  private pacedGen;
16
16
  /** True while the paced driver owns the camera — fireDueSteps must not dispatch camera actions against it. */
17
17
  private pacedDriving;
18
+ /** Story-time effect evaluation (effect-track.ts) — built lazily when the story clock owns effects, invalidated whenever steps rebuild. */
19
+ private effectTrack;
18
20
  private warnedPacedCameraSkip;
19
21
  private pacedCapture;
20
22
  private captured;
@@ -64,6 +66,22 @@ export declare class OmStoryElement extends HTMLElementBase {
64
66
  */
65
67
  private startPaced;
66
68
  private advanceBy;
69
+ /**
70
+ * The story clock owns effects when playback is pull-model: a PACED STORY
71
+ * (the recorder — wall-clock rAF effects would race the capture clock) or
72
+ * the determinism switch (frame renderers seek; runLayerEffect snaps
73
+ * there). Keyed on the `paced` ATTRIBUTE, deliberately not the transient
74
+ * pacedDriving flag: the flag drops asynchronously on pause, and a
75
+ * scrubber seek in that window would otherwise dispatch the verbs
76
+ * wall-clock (stamping end-state attributes, starting real rAF runners)
77
+ * that the resumed track then double-drives. The clock authority must be
78
+ * stable for a whole playback; flipping it mid-story is out of contract
79
+ * (the next seek re-evaluates cleanly). Interactive wall-clock playback
80
+ * keeps dispatching the verbs as actions — the rAF path in effects.ts is
81
+ * untouched.
82
+ */
83
+ private storyClockOwnsEffects;
84
+ private ensureEffectTrack;
67
85
  private fireDueSteps;
68
86
  /** Steps and the timeline are (re)built lazily when idle — mid-play DOM edits apply on the next play/seek. */
69
87
  private ensureBuilt;
@@ -1,4 +1,4 @@
1
- import { r as p, n as d } from "./index-CPthQWzC.js";
1
+ import { r as p, n as d } from "./index-CuBGRyG-.js";
2
2
  function g(t) {
3
3
  if (t == null) return !0;
4
4
  const e = t, n = e.id?.code;
@@ -1,4 +1,4 @@
1
- import { ae as _t, af as Ct } from "./index-CPthQWzC.js";
1
+ import { ae as _t, af as Ct } from "./index-CuBGRyG-.js";
2
2
  function Yt(e, r, t = 2, i, o = "xy") {
3
3
  const s = r && r.length, l = s ? r[0] * t : e.length;
4
4
  let c = Ut(e, 0, l, t, !0, i && i[0], o);
@@ -1,5 +1,5 @@
1
- import { i as E, j as S, k as R, o as N, p as h, q as w, s as O, t as W, v as x, w as I, x as B, y as _, A as P, B as k, E as $, F as z, H as v, I as F, J as C, K as U, N as p, O as M } from "./index-CPthQWzC.js";
2
- import { P as $e, R as ze, _ as ve, Q as Ce, S as Ue, T as Me, U as je, X as De, Y as Je, Z as qe, $ as He, a0 as Ve, a1 as Ge, a2 as Ke, a3 as Qe, a4 as Xe, a5 as Ye, a6 as Ze, a7 as et, a8 as tt, a9 as nt, aa as rt, ab as at, ac as st, ad as ot } from "./index-CPthQWzC.js";
1
+ import { i as E, j as S, k as R, o as N, p as h, q as w, s as O, t as W, v as x, w as I, x as B, y as _, A as P, B as k, E as $, F as z, H as v, I as F, J as C, K as U, N as p, O as M } from "./index-CuBGRyG-.js";
2
+ import { P as $e, R as ze, _ as ve, Q as Ce, S as Ue, T as Me, U as je, X as De, Y as Je, Z as qe, $ as He, a0 as Ve, a1 as Ge, a2 as Ke, a3 as Qe, a4 as Xe, a5 as Ye, a6 as Ze, a7 as et, a8 as tt, a9 as nt, aa as rt, ab as at, ac as st, ad as ot } from "./index-CuBGRyG-.js";
3
3
  import { g as j, i as D } from "./table-accessors-CYWTzpQI.js";
4
4
  async function J(t, e, n = {}, r = {}) {
5
5
  const a = E(t), s = S.getWorkerFarm(n), { source: o } = n, c = { name: a, source: o };
@@ -1,4 +1,4 @@
1
- import { ag as Be, ah as le, ai as ce, aj as De, ak as Oe, al as ke } from "./index-CPthQWzC.js";
1
+ import { ag as Be, ah as le, ai as ce, aj as De, ak as Oe, al as ke } from "./index-CuBGRyG-.js";
2
2
  import { y as ve, a as he, z as G, R as J, A as ue, C as Fe, F as je, n as xe, S as Ie, E as Ne } from "./recordbatch-Bpc0uxFn.js";
3
3
  import { g as V, a as fe, b as Le, c as Ue, d as Me, e as qe, m as Ve } from "./table-accessors-CYWTzpQI.js";
4
4
  import { c as $e } from "./convert-arrow-schema-DrAihRf9.js";