@wardic/core 1.0.1 → 1.1.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/Batch.d.ts +4 -2
- package/dist/Batch.d.ts.map +1 -1
- package/dist/Batch.js +80 -13
- package/dist/Batch.js.map +1 -1
- package/dist/DefaultTransition.d.ts.map +1 -1
- package/dist/DefaultTransition.js +1 -1
- package/dist/DefaultTransition.js.map +1 -1
- package/dist/LiveValue.d.ts +61 -0
- package/dist/LiveValue.d.ts.map +1 -1
- package/dist/LiveValue.js +79 -5
- package/dist/LiveValue.js.map +1 -1
- package/dist/Machine.d.ts +10 -1
- package/dist/Machine.d.ts.map +1 -1
- package/dist/Machine.js +18 -1
- package/dist/Machine.js.map +1 -1
- package/dist/Renderer.js +2 -2
- package/dist/Renderer.js.map +1 -1
- package/dist/Spans.d.ts +41 -0
- package/dist/Spans.d.ts.map +1 -0
- package/dist/Spans.js +39 -0
- package/dist/Spans.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/frameLoop.d.ts +1 -1
- package/dist/internal/frameLoop.d.ts.map +1 -1
- package/dist/internal/frameLoop.js +42 -19
- package/dist/internal/frameLoop.js.map +1 -1
- package/dist/internal/options.d.ts.map +1 -1
- package/dist/internal/options.js +2 -2
- package/dist/internal/options.js.map +1 -1
- package/dist/internal/tracing.d.ts +34 -14
- package/dist/internal/tracing.d.ts.map +1 -1
- package/dist/internal/tracing.js +56 -24
- package/dist/internal/tracing.js.map +1 -1
- package/dist/unstable/AnimationControls.d.ts +110 -0
- package/dist/unstable/AnimationControls.d.ts.map +1 -0
- package/dist/unstable/AnimationControls.js +107 -0
- package/dist/unstable/AnimationControls.js.map +1 -0
- package/dist/unstable/AppearHandoff.d.ts +53 -0
- package/dist/unstable/AppearHandoff.d.ts.map +1 -0
- package/dist/unstable/AppearHandoff.js +23 -0
- package/dist/unstable/AppearHandoff.js.map +1 -0
- package/dist/unstable/Config.d.ts +285 -0
- package/dist/unstable/Config.d.ts.map +1 -0
- package/dist/unstable/Config.js +3 -0
- package/dist/unstable/Config.js.map +1 -0
- package/dist/unstable/FlushGate.d.ts +222 -0
- package/dist/unstable/FlushGate.d.ts.map +1 -0
- package/dist/unstable/FlushGate.js +567 -0
- package/dist/unstable/FlushGate.js.map +1 -0
- package/dist/unstable/FrameTime.d.ts +21 -0
- package/dist/unstable/FrameTime.d.ts.map +1 -0
- package/dist/unstable/FrameTime.js +45 -0
- package/dist/unstable/FrameTime.js.map +1 -0
- package/dist/unstable/MeasuredPairs.d.ts +51 -0
- package/dist/unstable/MeasuredPairs.d.ts.map +1 -0
- package/dist/unstable/MeasuredPairs.js +20 -0
- package/dist/unstable/MeasuredPairs.js.map +1 -0
- package/dist/unstable/OwnValues.d.ts +29 -0
- package/dist/unstable/OwnValues.d.ts.map +1 -0
- package/dist/unstable/OwnValues.js +22 -0
- package/dist/unstable/OwnValues.js.map +1 -0
- package/dist/unstable/PresenceRecord.d.ts +176 -0
- package/dist/unstable/PresenceRecord.d.ts.map +1 -0
- package/dist/unstable/PresenceRecord.js +26 -0
- package/dist/unstable/PresenceRecord.js.map +1 -0
- package/dist/unstable/Reactivity.d.ts +29 -0
- package/dist/unstable/Reactivity.d.ts.map +1 -0
- package/dist/unstable/Reactivity.js +15 -0
- package/dist/unstable/Reactivity.js.map +1 -0
- package/dist/unstable/Report.d.ts +30 -0
- package/dist/unstable/Report.d.ts.map +1 -0
- package/dist/unstable/Report.js +66 -0
- package/dist/unstable/Report.js.map +1 -0
- package/dist/unstable/RetargetLegs.d.ts +189 -0
- package/dist/unstable/RetargetLegs.d.ts.map +1 -0
- package/dist/unstable/RetargetLegs.js +834 -0
- package/dist/unstable/RetargetLegs.js.map +1 -0
- package/dist/unstable/Spine.d.ts +696 -0
- package/dist/unstable/Spine.d.ts.map +1 -0
- package/dist/unstable/Spine.js +2617 -0
- package/dist/unstable/Spine.js.map +1 -0
- package/dist/unstable/Stops.d.ts +82 -0
- package/dist/unstable/Stops.d.ts.map +1 -0
- package/dist/unstable/Stops.js +149 -0
- package/dist/unstable/Stops.js.map +1 -0
- package/dist/unstable/Subject.d.ts +11 -0
- package/dist/unstable/Subject.d.ts.map +1 -0
- package/dist/unstable/Subject.js +12 -0
- package/dist/unstable/Subject.js.map +1 -0
- package/dist/unstable/Timelines.d.ts +51 -0
- package/dist/unstable/Timelines.d.ts.map +1 -0
- package/dist/unstable/Timelines.js +10 -0
- package/dist/unstable/Timelines.js.map +1 -0
- package/dist/unstable/VariableValues.d.ts +27 -0
- package/dist/unstable/VariableValues.d.ts.map +1 -0
- package/dist/unstable/VariableValues.js +19 -0
- package/dist/unstable/VariableValues.js.map +1 -0
- package/dist/unstable/VariantTarget.d.ts +106 -0
- package/dist/unstable/VariantTarget.d.ts.map +1 -0
- package/dist/unstable/VariantTarget.js +185 -0
- package/dist/unstable/VariantTarget.js.map +1 -0
- package/dist/unstable/VariantTree.d.ts +351 -0
- package/dist/unstable/VariantTree.d.ts.map +1 -0
- package/dist/unstable/VariantTree.js +362 -0
- package/dist/unstable/VariantTree.js.map +1 -0
- package/dist/unstable/WardicConfigValue.d.ts +89 -0
- package/dist/unstable/WardicConfigValue.d.ts.map +1 -0
- package/dist/unstable/WardicConfigValue.js +106 -0
- package/dist/unstable/WardicConfigValue.js.map +1 -0
- package/dist/unstable/WardicServices.d.ts +46 -0
- package/dist/unstable/WardicServices.d.ts.map +1 -0
- package/dist/unstable/WardicServices.js +72 -0
- package/dist/unstable/WardicServices.js.map +1 -0
- package/package.json +1 -1
- package/src/Batch.ts +68 -12
- package/src/DefaultTransition.ts +1 -1
- package/src/LiveValue.ts +129 -5
- package/src/Machine.ts +22 -1
- package/src/Renderer.ts +2 -2
- package/src/Spans.ts +50 -0
- package/src/index.ts +1 -0
- package/src/internal/frameLoop.ts +44 -20
- package/src/internal/options.ts +2 -2
- package/src/internal/tracing.ts +82 -28
- package/src/unstable/AnimationControls.ts +199 -0
- package/src/unstable/AppearHandoff.ts +81 -0
- package/src/unstable/Config.ts +326 -0
- package/src/unstable/FlushGate.ts +730 -0
- package/src/unstable/FrameTime.ts +52 -0
- package/src/unstable/MeasuredPairs.ts +56 -0
- package/src/unstable/OwnValues.ts +32 -0
- package/src/unstable/PresenceRecord.ts +201 -0
- package/src/unstable/Reactivity.ts +35 -0
- package/src/unstable/Report.ts +75 -0
- package/src/unstable/RetargetLegs.ts +1062 -0
- package/src/unstable/Spine.ts +3275 -0
- package/src/unstable/Stops.ts +221 -0
- package/src/unstable/Subject.ts +13 -0
- package/src/unstable/Timelines.ts +58 -0
- package/src/unstable/VariableValues.ts +27 -0
- package/src/unstable/VariantTarget.ts +246 -0
- package/src/unstable/VariantTree.ts +643 -0
- package/src/unstable/WardicConfigValue.ts +154 -0
- package/src/unstable/WardicServices.ts +125 -0
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* given a token (`run(machine, sink, { supersede })`, #200) joins it, and `Supersede.end` takes
|
|
12
12
|
* it off at once too, completing its fiber with `Superseded`: no interrupt, and no interrupt
|
|
13
13
|
* cause for every finalizer to combine (ADR-0027, *Amendment (#200)*).
|
|
14
|
-
* - **A burst** is the loop's one `Clock.ticks` subscription, held in a
|
|
14
|
+
* - **A burst** is the loop's one `Clock.ticks` subscription, held in a field of the loop's (#746) and forked
|
|
15
15
|
* under the Layer's build context (never a caller's scheduler or span, the Clock's own rule,
|
|
16
16
|
* ADR-0017). The first run starts it; it ends itself at the first tick with nothing left, so
|
|
17
17
|
* a Retarget (a removal, then an add, in one call) keeps it, and the Clock goes idle at its
|
|
@@ -64,8 +64,7 @@ import * as Data from "effect/Data"
|
|
|
64
64
|
import * as Deferred from "effect/Deferred"
|
|
65
65
|
import * as Effect from "effect/Effect"
|
|
66
66
|
import * as Exit from "effect/Exit"
|
|
67
|
-
import
|
|
68
|
-
import * as FiberHandle from "effect/FiberHandle"
|
|
67
|
+
import * as Fiber from "effect/Fiber"
|
|
69
68
|
import { constUndefined, identity } from "effect/Function"
|
|
70
69
|
import * as LogLevel from "effect/LogLevel"
|
|
71
70
|
import type * as Metric from "effect/Metric"
|
|
@@ -74,14 +73,14 @@ import * as Predicate from "effect/Predicate"
|
|
|
74
73
|
import * as References from "effect/References"
|
|
75
74
|
import type * as Scope from "effect/Scope"
|
|
76
75
|
import * as Stream from "effect/Stream"
|
|
77
|
-
import * as Tracer from "effect/Tracer"
|
|
76
|
+
import type * as Tracer from "effect/Tracer"
|
|
78
77
|
import * as UndefinedOr from "effect/UndefinedOr"
|
|
79
78
|
import * as Clock from "../Clock.ts"
|
|
80
79
|
import type * as Frame from "../Frame.ts"
|
|
81
80
|
import * as Supersede from "../Supersede.ts"
|
|
82
81
|
import type * as FrameLoop from "../FrameLoop.ts"
|
|
83
82
|
import type * as Machine from "../Machine.ts"
|
|
84
|
-
import {
|
|
83
|
+
import { none, SpansGiven, traced } from "./tracing.ts"
|
|
85
84
|
|
|
86
85
|
// @wardic/core compiles against ES2022 alone, which does not declare `performance` (see
|
|
87
86
|
// refresh-frame-clock.ts). It is a host global in every Environment Wardic targets.
|
|
@@ -280,9 +279,12 @@ const joinSupersede = (token: Supersede.Supersede, run: Supersede.Run): void =>
|
|
|
280
279
|
runs.push(run)
|
|
281
280
|
}
|
|
282
281
|
|
|
282
|
+
/** A burst's fork: started at once, inline, as `FiberHandle.run` started it (#746). */
|
|
283
|
+
const START_NOW = { startImmediately: true } as const
|
|
284
|
+
|
|
283
285
|
/**
|
|
284
286
|
* Build the Frame loop over the Environment's `Clock`. Needs a `Scope` (the burst's
|
|
285
|
-
*
|
|
287
|
+
* fiber ends with it), so the `FrameLoop` module wraps it as its `layer`. Its span
|
|
286
288
|
* captures no call-site stack (ADR-0040, decision 2), so not `Effect.fn`, which always does:
|
|
287
289
|
* `Effect.fnUntraced`, the span its pipeable (#460, Q6).
|
|
288
290
|
*/
|
|
@@ -291,7 +293,29 @@ export const make = Effect.fnUntraced(
|
|
|
291
293
|
const clock = yield* Clock.Clock
|
|
292
294
|
// The burst runs here, under the Layer's build context, never in a caller's.
|
|
293
295
|
const buildContext = yield* Effect.context<Clock.Clock | Scope.Scope>()
|
|
294
|
-
|
|
296
|
+
// The burst's fiber (#746: what a `FiberHandle` held, in a field, so an app ships no FiberHandle): a
|
|
297
|
+
// new burst's replaces it, interrupting it, and the loop's Scope interrupts it and lets it go. Once
|
|
298
|
+
// that Scope has closed, the loop takes no run (`entered`), as the handle's closed state had it.
|
|
299
|
+
let held: Fiber.Fiber<void> | undefined
|
|
300
|
+
let closed = false
|
|
301
|
+
yield* Effect.addFinalizer(() =>
|
|
302
|
+
Effect.suspend(() => {
|
|
303
|
+
closed = true
|
|
304
|
+
const last = held
|
|
305
|
+
held = undefined
|
|
306
|
+
return UndefinedOr.match(last, { onUndefined: () => Effect.void, onDefined: Fiber.interrupt })
|
|
307
|
+
}),
|
|
308
|
+
)
|
|
309
|
+
/** Hold `fiber`, the burst just forked: the one before it, still ending its runs, is interrupted. */
|
|
310
|
+
const hold = (fiber: Fiber.Fiber<void>): void => {
|
|
311
|
+
const previous = held
|
|
312
|
+
// Held before the interruption, which may re-enter through a finalizer, as FiberHandle does.
|
|
313
|
+
held = fiber
|
|
314
|
+
if (Predicate.isNotUndefined(previous)) previous.interruptUnsafe()
|
|
315
|
+
fiber.addObserver(() => {
|
|
316
|
+
if (held === fiber) held = undefined
|
|
317
|
+
})
|
|
318
|
+
}
|
|
295
319
|
const entries: Array<Entry> = []
|
|
296
320
|
// The runs `runLast` added, stepped after `entries` in each tick.
|
|
297
321
|
const lastEntries: Array<Entry> = []
|
|
@@ -300,8 +324,8 @@ export const make = Effect.fnUntraced(
|
|
|
300
324
|
// removes.
|
|
301
325
|
let hooks: ReadonlyArray<Hook> = []
|
|
302
326
|
// Whether a burst holds the loop's subscription. A run's continuation runs inline while the
|
|
303
|
-
// ending burst is still
|
|
304
|
-
//
|
|
327
|
+
// ending burst is still `held`, so the loop tracks its burst here rather than asking whether one
|
|
328
|
+
// is held (#81).
|
|
305
329
|
let bursting = false
|
|
306
330
|
// The Late window (ADR-0027 *Amendment (#680)*): open from a tick's first step until the microtask
|
|
307
331
|
// queued at its end has run. `windowQueued` keeps one microtask per window, however many ticks open
|
|
@@ -529,11 +553,7 @@ export const make = Effect.fnUntraced(
|
|
|
529
553
|
}
|
|
530
554
|
|
|
531
555
|
/** The burst's fiber, if one holds the subscription. */
|
|
532
|
-
const burstFiber = (): Fiber.Fiber<void, unknown> | undefined =>
|
|
533
|
-
const state = burst.state
|
|
534
|
-
if (state._tag === "Closed") return undefined
|
|
535
|
-
return state.fiber
|
|
536
|
-
}
|
|
556
|
+
const burstFiber = (): Fiber.Fiber<void, unknown> | undefined => held
|
|
537
557
|
|
|
538
558
|
const afterTick = (hook: (dt: number) => undefined): Effect.Effect<void, never, Scope.Scope> => {
|
|
539
559
|
const added: Hook = { hook }
|
|
@@ -585,14 +605,17 @@ export const make = Effect.fnUntraced(
|
|
|
585
605
|
|
|
586
606
|
/**
|
|
587
607
|
* Start a burst unless one holds the subscription, inline: no scheduler hop before the
|
|
588
|
-
* subscription. While a burst ends its runs, the new one replaces it
|
|
608
|
+
* subscription. While a burst ends its runs, the new one replaces it as the one `held` (#81). A
|
|
609
|
+
* closed loop never gets here: it takes no run (`entered`).
|
|
589
610
|
*/
|
|
590
611
|
const startBurst: Effect.Effect<unknown> = Effect.suspend(() =>
|
|
591
612
|
Bool.match(bursting, {
|
|
592
613
|
onTrue: () => Effect.void,
|
|
593
614
|
onFalse: () => {
|
|
594
615
|
bursting = true
|
|
595
|
-
|
|
616
|
+
// Detached and started at once, as `FiberHandle.run` forks: no scheduler hop before the
|
|
617
|
+
// subscription, and no caller's fiber its parent.
|
|
618
|
+
return Effect.map(Effect.forkDetach(ticking, START_NOW), hold)
|
|
596
619
|
},
|
|
597
620
|
}),
|
|
598
621
|
)
|
|
@@ -610,9 +633,10 @@ export const make = Effect.fnUntraced(
|
|
|
610
633
|
const logged = !LogLevel.isGreaterThan(fiber.getRef(References.MinimumLogLevel), "Debug")
|
|
611
634
|
// The metrics from the first run whose fiber has them (#518); none is read once they're in.
|
|
612
635
|
if (Predicate.isUndefined(metrics)) metrics = fiber.getRef(MetricsGiven)
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
636
|
+
// Its span, the app's to give (#746): none without `Spans.layer`, and no closure for it.
|
|
637
|
+
const spans = fiber.getRef(SpansGiven)
|
|
638
|
+
if (spans === none) return added(lane, late, machine, sink, options, undefined, logged)
|
|
639
|
+
return spans.run(fiber, machine.span.name, machine.span.attributes, (span) => added(lane, late, machine, sink, options, span, logged))
|
|
616
640
|
})) as Run
|
|
617
641
|
|
|
618
642
|
/**
|
|
@@ -659,7 +683,7 @@ export const make = Effect.fnUntraced(
|
|
|
659
683
|
span: Tracer.Span | undefined,
|
|
660
684
|
): Effect.Effect<Entry> => {
|
|
661
685
|
// A closed Environment takes no runs: nothing would tick them.
|
|
662
|
-
if (
|
|
686
|
+
if (closed) return Effect.interrupt
|
|
663
687
|
let checkedSink: FrameLoop.Sink<F> = sink
|
|
664
688
|
if (check) checkedSink = checked(sink)
|
|
665
689
|
const entry: Entry = {
|
package/src/internal/options.ts
CHANGED
|
@@ -131,10 +131,10 @@ export const checked = <A>(check: Check<A>, value: unknown, name?: string): A =>
|
|
|
131
131
|
throw new OptionError({ message: under(`["${name}"]`, failure) })
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
const NO_STEPS = expected("a count of 1 or more")
|
|
134
|
+
const NO_STEPS = /*#__PURE__*/ expected("a count of 1 or more")
|
|
135
135
|
|
|
136
136
|
/** A count of steps: a finite number, 1 or more. */
|
|
137
|
-
export const stepCount: Check<number> = refine(finite, (n) => n >= 1 || NO_STEPS)
|
|
137
|
+
export const stepCount: Check<number> = /*#__PURE__*/ refine(finite, (n) => n >= 1 || NO_STEPS)
|
|
138
138
|
|
|
139
139
|
/** A finite number above 0. */
|
|
140
140
|
export const positive: Check<number> = refine(finite, (n) => n > 0 || NOT_POSITIVE)
|
package/src/internal/tracing.ts
CHANGED
|
@@ -1,58 +1,112 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Core's spans
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* Core's spans (#746, ADR-0067 *Amendment (#746)*, decision 8): opened through what the app gives,
|
|
3
|
+
* `Spans.layer`, read from the fiber where each would open. With nothing given, `none` opens none, and
|
|
4
|
+
* no module an app imports names Effect's `Tracer`. Given, each opens only where something reads it
|
|
5
|
+
* (#460, ADR-0040 *Amendment (#460)*): a tracer installed other than Effect's default, tracing on. No
|
|
6
|
+
* span captures a call-site stack (ADR-0040, decision 2).
|
|
7
7
|
*/
|
|
8
8
|
import * as Channel from "effect/Channel"
|
|
9
|
+
import * as Context from "effect/Context"
|
|
9
10
|
import * as Effect from "effect/Effect"
|
|
10
11
|
import type * as Fiber from "effect/Fiber"
|
|
11
12
|
import * as References from "effect/References"
|
|
12
13
|
import type * as Scope from "effect/Scope"
|
|
13
14
|
import * as Stream from "effect/Stream"
|
|
14
15
|
import * as Tracer from "effect/Tracer"
|
|
16
|
+
import type * as Spans from "../Spans.ts"
|
|
15
17
|
|
|
16
|
-
/**
|
|
17
|
-
export interface
|
|
18
|
-
|
|
19
|
-
readonly
|
|
18
|
+
/** What opens Wardic's spans, read from the fiber where each would open. */
|
|
19
|
+
export interface Shape {
|
|
20
|
+
/** `self` under the span `name`, when `fiber` is traced. */
|
|
21
|
+
readonly traced: <A, E, R>(fiber: Fiber.Fiber<unknown, unknown>, self: Effect.Effect<A, E, R>, name: string, options: Spans.Options) => Effect.Effect<A, E, R>
|
|
22
|
+
/** `self` under the span `name` for its Scope's life, when `fiber` is traced. */
|
|
23
|
+
readonly tracedScoped: <A, E, R>(
|
|
24
|
+
fiber: Fiber.Fiber<unknown, unknown>,
|
|
25
|
+
self: Effect.Effect<A, E, R>,
|
|
26
|
+
name: string,
|
|
27
|
+
options: Spans.Options,
|
|
28
|
+
) => Effect.Effect<A, E, R | Scope.Scope>
|
|
29
|
+
/** `self` under the span `name`, when `fiber`, the one running it, is traced; `self` itself, the same Stream, otherwise. */
|
|
30
|
+
readonly tracedStream: <A, E, R>(fiber: Fiber.Fiber<unknown, unknown>, self: Stream.Stream<A, E, R>, name: string, options: Spans.Options) => Stream.Stream<A, E, R>
|
|
31
|
+
/**
|
|
32
|
+
* `body` under the span `name`, the `ParentSpan` of what runs inside it, with no stack frame
|
|
33
|
+
* (ADR-0040, decision 3), when `fiber` is traced: what a Frame loop run opens. `body` is given the
|
|
34
|
+
* span, or `undefined` with none.
|
|
35
|
+
*/
|
|
36
|
+
readonly run: <A, E, R>(
|
|
37
|
+
fiber: Fiber.Fiber<unknown, unknown>,
|
|
38
|
+
name: string,
|
|
39
|
+
attributes: Readonly<Record<string, unknown>>,
|
|
40
|
+
body: (span: Tracer.Span | undefined) => Effect.Effect<A, E, R>,
|
|
41
|
+
) => Effect.Effect<A, E, R>
|
|
20
42
|
}
|
|
21
43
|
|
|
22
|
-
/**
|
|
23
|
-
export const
|
|
44
|
+
/** Opens no span: what's read without `Spans.layer`. */
|
|
45
|
+
export const none: Shape = {
|
|
46
|
+
traced: (_, self) => self,
|
|
47
|
+
tracedScoped: (_, self) => self,
|
|
48
|
+
tracedStream: (_, self) => self,
|
|
49
|
+
run: (_, __, ___, body) => body(undefined),
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Whether a fiber's spans reach anything: a tracer installed, not Effect's default `nativeTracer` (the
|
|
54
|
+
* comparison Effect's `Tracer` documents for this), and tracing on. With Effect's default, a span is
|
|
55
|
+
* recorded that nothing reads, and its `ParentSpan` gives the fiber a new context root.
|
|
56
|
+
*/
|
|
57
|
+
const isTraced = (fiber: Fiber.Fiber<unknown, unknown>): boolean =>
|
|
24
58
|
fiber.getRef(Tracer.Tracer) !== Tracer.nativeTracer && fiber.getRef(References.TracerEnabled)
|
|
25
59
|
|
|
26
|
-
/**
|
|
27
|
-
export const
|
|
28
|
-
|
|
60
|
+
/** Opens each span where its fiber is traced: what `Spans.layer` gives. */
|
|
61
|
+
export const opening: Shape = {
|
|
62
|
+
traced: (fiber, self, name, options) => {
|
|
29
63
|
if (!isTraced(fiber)) return self
|
|
30
64
|
return Effect.withSpan(self, name, { ...options, captureStackTrace: false })
|
|
31
|
-
}
|
|
65
|
+
},
|
|
66
|
+
tracedScoped: (fiber, self, name, options) => {
|
|
67
|
+
if (!isTraced(fiber)) return self
|
|
68
|
+
return Effect.withSpanScoped(self, name, { ...options, captureStackTrace: false })
|
|
69
|
+
},
|
|
70
|
+
tracedStream: (fiber, self, name, options) => {
|
|
71
|
+
if (!isTraced(fiber)) return self
|
|
72
|
+
return Stream.withSpan(self, name, { ...options, captureStackTrace: false })
|
|
73
|
+
},
|
|
74
|
+
run: (fiber, name, attributes, body) => {
|
|
75
|
+
if (!isTraced(fiber)) return body(undefined)
|
|
76
|
+
return Effect.useSpan(name, { attributes }, (span) => Effect.provideService(body(span), Tracer.ParentSpan, span))
|
|
77
|
+
},
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** What opens Wardic's spans: {@link none} unless the app gives `Spans.layer`, as `FrameLoop`'s metrics are given (#518). */
|
|
81
|
+
export const SpansGiven: Context.Reference<Shape> = /*#__PURE__*/ Context.Reference<Shape>("@wardic/core/Spans", { defaultValue: () => none })
|
|
82
|
+
|
|
83
|
+
/** Whether a tracer reads the running fiber's spans while the app gives none: what development warns of. */
|
|
84
|
+
export const missing: Effect.Effect<boolean> = /*#__PURE__*/ Effect.withFiber((fiber) => Effect.succeed(isTraced(fiber) && fiber.getRef(SpansGiven) === none))
|
|
32
85
|
|
|
33
|
-
/** `self` under the span `name`
|
|
86
|
+
/** `self` under the span `name` when its fiber is traced and the app gives spans; as it is otherwise. */
|
|
87
|
+
export const traced = <A, E, R>(self: Effect.Effect<A, E, R>, name: string, options: Spans.Options = {}): Effect.Effect<A, E, R> =>
|
|
88
|
+
Effect.withFiber((fiber) => fiber.getRef(SpansGiven).traced(fiber, self, name, options))
|
|
89
|
+
|
|
90
|
+
/** `self` under the span `name` for its Scope's life when its fiber is traced and the app gives spans; as it is otherwise. */
|
|
34
91
|
export const tracedScoped = <A, E, R>(
|
|
35
92
|
self: Effect.Effect<A, E, R>,
|
|
36
93
|
name: string,
|
|
37
|
-
options:
|
|
38
|
-
): Effect.Effect<A, E, R | Scope.Scope> =>
|
|
39
|
-
Effect.withFiber((fiber): Effect.Effect<A, E, R | Scope.Scope> => {
|
|
40
|
-
if (!isTraced(fiber)) return self
|
|
41
|
-
return Effect.withSpanScoped(self, name, { ...options, captureStackTrace: false })
|
|
42
|
-
})
|
|
94
|
+
options: Spans.Options = {},
|
|
95
|
+
): Effect.Effect<A, E, R | Scope.Scope> => Effect.withFiber((fiber) => fiber.getRef(SpansGiven).tracedScoped(fiber, self, name, options))
|
|
43
96
|
|
|
44
97
|
/**
|
|
45
|
-
* `self` under the span `name` when the fiber running it is traced; as it is
|
|
46
|
-
* when the stream is run, and the pull handed on is `self`'s own: a
|
|
47
|
-
* every pull, per element per frame for a Stream consumer (+4–6% on
|
|
98
|
+
* `self` under the span `name` when the fiber running it is traced and the app gives spans; as it is
|
|
99
|
+
* otherwise. Decided once, when the stream is run, and the pull handed on is `self`'s own: a
|
|
100
|
+
* `Stream.unwrap` here suspended every pull, per element per frame for a Stream consumer (+4–6% on
|
|
101
|
+
* Bun's `ticksOnly`). `Shape.tracedStream` hands `self` back untraced, which is how it's told.
|
|
48
102
|
*/
|
|
49
|
-
export const tracedStream = <A, E, R>(self: Stream.Stream<A, E, R>, name: string, options:
|
|
103
|
+
export const tracedStream = <A, E, R>(self: Stream.Stream<A, E, R>, name: string, options: Spans.Options = {}): Stream.Stream<A, E, R> => {
|
|
50
104
|
const channel = Stream.toChannel(self)
|
|
51
105
|
return Stream.fromChannel(
|
|
52
106
|
Channel.fromTransform((upstream, scope) =>
|
|
53
107
|
Effect.withFiber((fiber) => {
|
|
54
|
-
|
|
55
|
-
|
|
108
|
+
const spanned = fiber.getRef(SpansGiven).tracedStream(fiber, self, name, options)
|
|
109
|
+
if (spanned === self) return Channel.toTransform(channel)(upstream, scope)
|
|
56
110
|
return Channel.toTransform(Stream.toChannel(spanned))(upstream, scope)
|
|
57
111
|
}),
|
|
58
112
|
),
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **Animation controls** (#433's PR 3, CONTEXT.md; Motion's `useAnimationControls`), on every binding:
|
|
3
|
+
* one object made outside any component and given as `animate={controls}` to any number of Wardic
|
|
4
|
+
* elements, which follow its calls.
|
|
5
|
+
*
|
|
6
|
+
* - **`start(definition, transitionOverride)`** sets each element's `animate` entry (a **Controls
|
|
7
|
+
* change**), so it Retargets, staggers its Variant children and lands as a change of the prop would.
|
|
8
|
+
* It resolves once each element and the Variant children it hands its names to have landed.
|
|
9
|
+
* - The override is the transition of that change: it beats the definition's own on the element and
|
|
10
|
+
* on each Variant child, and it is their orchestration (stagger, `when`), as Motion's
|
|
11
|
+
* `transitionOverride` is.
|
|
12
|
+
* - Their next Retarget, a gesture's, runs on their own transitions again.
|
|
13
|
+
* - **`set(definition)`** is an **Instant change**: the elements and their Variant children
|
|
14
|
+
* snap there, as Motion's `setValues` sets them.
|
|
15
|
+
* - **`stop()`** ends each element's running legs where they are.
|
|
16
|
+
*
|
|
17
|
+
* A function definition is called once per element, with its `custom`, values and velocities, as
|
|
18
|
+
* Motion's `controls.start((i) => …)`. An element hears the controls from its mount to its unmount.
|
|
19
|
+
*
|
|
20
|
+
* Unstable, for Wardic's own packages: public, with no semver promise.
|
|
21
|
+
*
|
|
22
|
+
* @module
|
|
23
|
+
*/
|
|
24
|
+
// Unstable: ADR-0071, decision 5. #672: solid's `animation-controls.ts`, moved for the spine to join and
|
|
25
|
+
// leave a Controls change in core.
|
|
26
|
+
import type * as Values from "../Values.ts"
|
|
27
|
+
import * as Arr from "effect/Array"
|
|
28
|
+
import * as Bool from "effect/Boolean"
|
|
29
|
+
import * as Predicate from "effect/Predicate"
|
|
30
|
+
import * as UndefinedOr from "effect/UndefinedOr"
|
|
31
|
+
import * as Config from "./Config.ts"
|
|
32
|
+
|
|
33
|
+
// #672: declared here, as core's `Microtask.ts` declares it, since core builds with no DOM in its lib.
|
|
34
|
+
declare const queueMicrotask: (callback: () => void) => void
|
|
35
|
+
|
|
36
|
+
// #672: the controls' interface, its definition and its mark are Config's, where the config types
|
|
37
|
+
// reach them.
|
|
38
|
+
export type { WardicAnimationControls, WardicControlsDefinition } from "./Config.ts"
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* A **Controls change** (#433): what one `start` or `set` set one element's `animate` entry to, the
|
|
42
|
+
* transition it runs on, and the landings it waits for. The element and each Variant child it reaches
|
|
43
|
+
* join it at the Retarget it makes them run, and leave at that one's landing (or the next's).
|
|
44
|
+
*/
|
|
45
|
+
export interface ControlsChange {
|
|
46
|
+
/** Its place among every change: a trigger key part, so a change is a trigger even to the same name. */
|
|
47
|
+
readonly serial: number
|
|
48
|
+
/** The element's `animate` entry: a target or a name, a resolver already called. */
|
|
49
|
+
readonly definition: Config.WardicVariant | Config.WardicVariantLabels
|
|
50
|
+
/** The transition of the change (start's override, set's instant one), or none: the element's own. */
|
|
51
|
+
readonly override: Config.WardicTransition | undefined
|
|
52
|
+
/** Elements in it that haven't landed. */
|
|
53
|
+
pending: number
|
|
54
|
+
/** Whether every element it reaches has had its chance to join: its binding's flush has run. */
|
|
55
|
+
armed: boolean
|
|
56
|
+
/** Told once it has landed. */
|
|
57
|
+
readonly landed: () => void
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** What a controlled element does at a change, as its binding wires it: its entry set, and the change's landing promised. */
|
|
61
|
+
export interface Controlled {
|
|
62
|
+
readonly change: (definition: Config.WardicControlsDefinition, override: Config.WardicTransition | undefined) => Promise<void>
|
|
63
|
+
readonly stop: () => void
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** The elements each controls reach, by the controls. */
|
|
67
|
+
// Module state (#460, Q7): each controls object's subscribers, held weakly by it.
|
|
68
|
+
const subscribers = new WeakMap<Config.WardicAnimationControls, Set<Controlled>>()
|
|
69
|
+
|
|
70
|
+
/** `set`'s transition (#433, Motion's `setValues`): none to speak of, and no orchestration. */
|
|
71
|
+
export const INSTANT: Config.WardicTransition = { type: "tween", duration: 0 }
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Makes animation controls, which animate elements from code by their variants or targets: give them
|
|
75
|
+
* to each element as `animate={controls}`, on a `w.*` element, in a ward's config or on a
|
|
76
|
+
* `Reorder.Item`, then `start`, `set` or `stop` them. Needs no owner. Motion's `useAnimationControls`.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* const controls = createAnimationControls()
|
|
80
|
+
* <w.ul initial="hidden" animate={controls} variants={list}>…</w.ul>
|
|
81
|
+
* await controls.start("visible")
|
|
82
|
+
* @see https://wardic.dev/reference/solid/animation/create-animation-controls
|
|
83
|
+
*/
|
|
84
|
+
// #433's PR 3: each `start` or `set` is a Controls change of each element's `animate` entry.
|
|
85
|
+
export const createAnimationControls = (): Config.WardicAnimationControls => {
|
|
86
|
+
const reached = new Set<Controlled>()
|
|
87
|
+
const controls: Config.WardicAnimationControls = {
|
|
88
|
+
[Config.CONTROLS]: true,
|
|
89
|
+
start: (definition, transitionOverride) =>
|
|
90
|
+
Promise.all(Arr.map(Arr.fromIterable(reached), (element) => element.change(definition, transitionOverride))).then(() => undefined),
|
|
91
|
+
set: (definition) =>
|
|
92
|
+
reached.forEach((element) => {
|
|
93
|
+
void element.change(definition, INSTANT)
|
|
94
|
+
}),
|
|
95
|
+
stop: () => reached.forEach((element) => element.stop()),
|
|
96
|
+
}
|
|
97
|
+
subscribers.set(controls, reached)
|
|
98
|
+
return controls
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** Whether `u` is **Animation controls** (Motion's `isAnimationControls`). */
|
|
102
|
+
export const isAnimationControls = (u: unknown): u is Config.WardicAnimationControls => Predicate.hasProperty(u, Config.CONTROLS)
|
|
103
|
+
|
|
104
|
+
/** Reach `element` from `controls`, until the returned function: its mount to its unmount. */
|
|
105
|
+
export const subscribe = (controls: Config.WardicAnimationControls, element: Controlled): (() => void) => {
|
|
106
|
+
const reached = subscribers.get(controls)
|
|
107
|
+
if (Predicate.isUndefined(reached)) return () => undefined
|
|
108
|
+
reached.add(element)
|
|
109
|
+
return () => {
|
|
110
|
+
reached.delete(element)
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** The changes made, counted. */
|
|
115
|
+
// Module state (#460, Q7): an id counter, only compared for order and identity.
|
|
116
|
+
let serials = 0
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* A change of one element (#433): its entry, `definition` called with the element's `custom`, values
|
|
120
|
+
* and velocities when it's a resolver (once, as Motion's), on `override`; and its landing, promised. It
|
|
121
|
+
* lands once every element it reaches has joined, at the end of the binding's flush (`armed`), and
|
|
122
|
+
* left. One that reaches no element lands then.
|
|
123
|
+
*/
|
|
124
|
+
export const changeOf = (
|
|
125
|
+
definition: Config.WardicControlsDefinition,
|
|
126
|
+
override: Config.WardicTransition | undefined,
|
|
127
|
+
custom: unknown,
|
|
128
|
+
values: Readonly<Record<string, number | string>>,
|
|
129
|
+
velocities: Readonly<Record<string, number>>,
|
|
130
|
+
): { readonly change: ControlsChange; readonly landing: Promise<void> } => {
|
|
131
|
+
let resolve!: () => void
|
|
132
|
+
const landing = new Promise<void>((done) => {
|
|
133
|
+
resolve = done
|
|
134
|
+
})
|
|
135
|
+
const entry = Bool.match(Predicate.isFunction(definition), {
|
|
136
|
+
onTrue: () => (definition as Config.WardicVariantResolver)(custom, { ...values }, { ...velocities }),
|
|
137
|
+
onFalse: () => definition as Config.WardicVariant | Config.WardicVariantLabels,
|
|
138
|
+
})
|
|
139
|
+
const change: ControlsChange = { serial: ++serials, definition: entry, override, pending: 0, armed: false, landed: resolve }
|
|
140
|
+
return { change, landing }
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** An element joins `change`: it runs a Retarget for it. */
|
|
144
|
+
export const join = (change: ControlsChange): void => {
|
|
145
|
+
change.pending++
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** An element in `change` landed, or left it (a later change, its unmount): it lands once none is left and it's armed. */
|
|
149
|
+
export const leave = (change: ControlsChange): void => {
|
|
150
|
+
change.pending--
|
|
151
|
+
if (change.armed && change.pending <= 0) change.landed()
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** `change` armed, its binding's flush having run: it lands now if no element joined, or all have left. */
|
|
155
|
+
export const arm = (change: ControlsChange): void => {
|
|
156
|
+
change.armed = true
|
|
157
|
+
if (change.pending <= 0) change.landed()
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* An element's config with **Animation controls** for its `animate` (#433), as everything but its
|
|
162
|
+
* controls reads it: `change`'s entry (none before the first), and marked controlled, so it names its
|
|
163
|
+
* own variants whatever the entry is (Motion's `isControllingVariants`).
|
|
164
|
+
*/
|
|
165
|
+
export const controlledConfigOf = <C extends Pick<Config.SpineConfig, "animate">>(config: C, change: ControlsChange | undefined): C =>
|
|
166
|
+
({ ...config, animate: UndefinedOr.map(change, (c) => c.definition), controlled: true }) as C
|
|
167
|
+
|
|
168
|
+
/** A config as a server reads it (#433): one given **Animation controls** has no entry yet, and is controlled. */
|
|
169
|
+
export const uncontrolledOf = <C extends Pick<Config.SpineConfig, "animate">>(config: C): C =>
|
|
170
|
+
Bool.match(isAnimationControls(config.animate), { onTrue: () => controlledConfigOf(config, undefined), onFalse: () => config })
|
|
171
|
+
|
|
172
|
+
/** What a controlled element reads at a change: its `custom`, and its values and velocities now (its Snapshot). */
|
|
173
|
+
export interface ControlledState {
|
|
174
|
+
readonly custom: () => unknown
|
|
175
|
+
/** Its Snapshot: its values, and its velocities now (#663), a spring leg's being on its Frame. */
|
|
176
|
+
readonly snapshot: ControlledSnapshot
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/** What Animation controls read of an element's Snapshot: its values, and its velocities now (#663). */
|
|
180
|
+
// #672: the controls name what they read, so they import nothing of the spine, whose Snapshot meets it.
|
|
181
|
+
export interface ControlledSnapshot {
|
|
182
|
+
readonly values: Values.Values
|
|
183
|
+
velocitiesNow(snapshot: ControlledSnapshot): Readonly<Record<string, number>>
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* A mounted element as its controls reach it (#433): a change sets its entry through `setChange`, its
|
|
188
|
+
* binding's signal, and arms once the binding's flush has run (a microtask after, Solid 2's included),
|
|
189
|
+
* every element it reaches joined by then; `stop` ends its legs.
|
|
190
|
+
*/
|
|
191
|
+
export const controlledElement = (setChange: (change: ControlsChange) => void, state: ControlledState, stop: () => void): Controlled => ({
|
|
192
|
+
change: (definition, override) => {
|
|
193
|
+
const made = changeOf(definition, override, state.custom(), state.snapshot.values, state.snapshot.velocitiesNow(state.snapshot))
|
|
194
|
+
setChange(made.change)
|
|
195
|
+
queueMicrotask(() => arm(made.change))
|
|
196
|
+
return made.landing
|
|
197
|
+
},
|
|
198
|
+
stop,
|
|
199
|
+
})
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An element's mount animation as both sides describe it, and its **Handoff** as the spine reads it
|
|
3
|
+
* (#48, ADR-0044): how far in its first legs start, from where its Appear animation has got. Its
|
|
4
|
+
* binding samples a server's and finds a client's.
|
|
5
|
+
*
|
|
6
|
+
* Unstable, for Wardic's own packages: public, with no semver promise.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
// Unstable: ADR-0071, decision 5. #672 (PR4-Q3): solid's `appear-handoff.ts`, what of its `appear.ts` the
|
|
11
|
+
// spine reads, moved for the spine in core; the rest of `appear.ts` goes to dom with its importers.
|
|
12
|
+
import type * as Machine from "../Machine.ts"
|
|
13
|
+
import type * as Values from "../Values.ts"
|
|
14
|
+
import * as Bool from "effect/Boolean"
|
|
15
|
+
import * as UndefinedOr from "effect/UndefinedOr"
|
|
16
|
+
import type * as Config from "./Config.ts"
|
|
17
|
+
import * as RetargetLegs from "./RetargetLegs.ts"
|
|
18
|
+
|
|
19
|
+
/** An element's mount animation, described the same on the server and the client. */
|
|
20
|
+
export interface MountAnimation {
|
|
21
|
+
/** The element's tag, by which its Environment routes some keys; `undefined` for an element whose tag isn't known. */
|
|
22
|
+
readonly tag: string | undefined
|
|
23
|
+
/** Each animated key's start. */
|
|
24
|
+
readonly from: Values.Values
|
|
25
|
+
/** Each animated key's target. */
|
|
26
|
+
readonly to: Values.Values
|
|
27
|
+
/** The element's own transition: its stagger isn't in it (ADR-0007). */
|
|
28
|
+
readonly transition: Config.WardicTransition | undefined
|
|
29
|
+
/** Whether reduced motion is on for it (ADR-0029). */
|
|
30
|
+
readonly reduced: boolean
|
|
31
|
+
/**
|
|
32
|
+
* Whether it's a layout node (#245): drawn through its projection at rest, as the client draws
|
|
33
|
+
* it, its own translate on top (#363). Part of its key.
|
|
34
|
+
*/
|
|
35
|
+
readonly layout: boolean
|
|
36
|
+
/** Each key's Keyframes of more than two stops (#429), `from` at their first: part of its key. Left out with none. */
|
|
37
|
+
readonly stops?: RetargetLegs.StopsByKey | undefined
|
|
38
|
+
/**
|
|
39
|
+
* Whether it's a **Skipped animation** (#468): every key lands on its first frame, so its Appear
|
|
40
|
+
* animation takes 0 s, holding its end from first paint. Part of its key; left out when it isn't.
|
|
41
|
+
*/
|
|
42
|
+
readonly skipped?: boolean | undefined
|
|
43
|
+
/** Its **Transform template** (#443): its stops drawn through it, as the client draws them. Left out with none. */
|
|
44
|
+
readonly template?: Config.SpineConfig["transformTemplate"]
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Whether a transition repeats for ever: a tween's `repeat: Infinity`, a tween as it runs (ADR-0051). */
|
|
48
|
+
export const repeatsForever = (transition: Config.WardicTransition | undefined): boolean =>
|
|
49
|
+
UndefinedOr.match(RetargetLegs.runOf(transition), { onUndefined: () => false, onDefined: (run) => Bool.and(run.type === "tween", (run as Machine.AnimateOptions).repeat === Number.POSITIVE_INFINITY) })
|
|
50
|
+
|
|
51
|
+
/** A transition's own delay, 0 without one. */
|
|
52
|
+
export const ownDelayOf = (transition: Config.WardicTransition | undefined): number =>
|
|
53
|
+
UndefinedOr.match(transition, { onUndefined: () => 0, onDefined: ({ delay = 0 }) => delay })
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The seconds an Appear animation holds before it moves, of the delay the client counts: a
|
|
57
|
+
* transition's own delay is in the animation, except a forever-repeating one's, which is sampled as
|
|
58
|
+
* one cycle, its own delay given with the stagger.
|
|
59
|
+
*/
|
|
60
|
+
const heldInAppear = (transition: Config.WardicTransition | undefined): number =>
|
|
61
|
+
Bool.match(repeatsForever(transition), { onTrue: () => 0, onFalse: () => ownDelayOf(transition) })
|
|
62
|
+
|
|
63
|
+
/** A mount animation's `skipped` (#468): left out when it isn't, so its key is as before. */
|
|
64
|
+
export const skippedField = (skipped: boolean): { readonly skipped?: true } => Bool.match(skipped, { onTrue: () => ({ skipped: true }) as const, onFalse: () => ({}) })
|
|
65
|
+
|
|
66
|
+
/** An element's Appear animation, found at mount: the spine starts its first legs as far in as it has got. */
|
|
67
|
+
export interface Handoff {
|
|
68
|
+
/** How far its animation has run, in seconds (its delay included). */
|
|
69
|
+
readonly elapsed: () => number
|
|
70
|
+
/** The delay its animation was given, in seconds. */
|
|
71
|
+
readonly delay: () => number
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* How far into its own run the client's first legs start, in seconds, read at their first tick:
|
|
76
|
+
* where the Appear animation has got, less what it waited that the client waits for itself. It
|
|
77
|
+
* waited its delay and its own hold; the client's legs hold their transition's delay (`clientDelay`,
|
|
78
|
+
* the stagger in it). The difference is a `when` wait, which the client has already waited.
|
|
79
|
+
*/
|
|
80
|
+
export const startAtOf = (handoff: Handoff, ownTransition: Config.WardicTransition | undefined, clientDelay: number) => (): number =>
|
|
81
|
+
handoff.elapsed() - handoff.delay() - heldInAppear(ownTransition) + clientDelay
|