@wardic/core 1.1.4 → 1.3.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.
Files changed (72) hide show
  1. package/dist/BaseValue.d.ts.map +1 -1
  2. package/dist/BaseValue.js +2 -0
  3. package/dist/BaseValue.js.map +1 -1
  4. package/dist/Batch.d.ts +6 -0
  5. package/dist/Batch.d.ts.map +1 -1
  6. package/dist/Batch.js +11 -6
  7. package/dist/Batch.js.map +1 -1
  8. package/dist/DefaultTransition.d.ts +21 -12
  9. package/dist/DefaultTransition.d.ts.map +1 -1
  10. package/dist/DefaultTransition.js +43 -2
  11. package/dist/DefaultTransition.js.map +1 -1
  12. package/dist/FrameLoop.d.ts +5 -1
  13. package/dist/FrameLoop.d.ts.map +1 -1
  14. package/dist/FrameLoop.js.map +1 -1
  15. package/dist/Machine.d.ts +3 -0
  16. package/dist/Machine.d.ts.map +1 -1
  17. package/dist/Machine.js +4 -3
  18. package/dist/Machine.js.map +1 -1
  19. package/dist/Spring.d.ts +7 -0
  20. package/dist/Spring.d.ts.map +1 -1
  21. package/dist/Spring.js +16 -0
  22. package/dist/Spring.js.map +1 -1
  23. package/dist/UnitScale.d.ts +39 -0
  24. package/dist/UnitScale.d.ts.map +1 -0
  25. package/dist/UnitScale.js +45 -0
  26. package/dist/UnitScale.js.map +1 -0
  27. package/dist/index.d.ts +1 -0
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +1 -0
  30. package/dist/index.js.map +1 -1
  31. package/dist/internal/frameLoop.js +5 -5
  32. package/dist/internal/frameLoop.js.map +1 -1
  33. package/dist/unstable/BatchCalls.d.ts +135 -0
  34. package/dist/unstable/BatchCalls.d.ts.map +1 -0
  35. package/dist/unstable/BatchCalls.js +311 -0
  36. package/dist/unstable/BatchCalls.js.map +1 -0
  37. package/dist/unstable/FrameEffects.d.ts +59 -0
  38. package/dist/unstable/FrameEffects.d.ts.map +1 -0
  39. package/dist/unstable/FrameEffects.js +142 -0
  40. package/dist/unstable/FrameEffects.js.map +1 -0
  41. package/dist/unstable/FrameTime.d.ts +1 -4
  42. package/dist/unstable/FrameTime.d.ts.map +1 -1
  43. package/dist/unstable/FrameTime.js +1 -4
  44. package/dist/unstable/FrameTime.js.map +1 -1
  45. package/dist/unstable/Imperative.d.ts +270 -0
  46. package/dist/unstable/Imperative.d.ts.map +1 -0
  47. package/dist/unstable/Imperative.js +745 -0
  48. package/dist/unstable/Imperative.js.map +1 -0
  49. package/dist/unstable/RetargetLegs.d.ts +2 -1
  50. package/dist/unstable/RetargetLegs.d.ts.map +1 -1
  51. package/dist/unstable/RetargetLegs.js +23 -15
  52. package/dist/unstable/RetargetLegs.js.map +1 -1
  53. package/dist/unstable/Spine.d.ts +8 -11
  54. package/dist/unstable/Spine.d.ts.map +1 -1
  55. package/dist/unstable/Spine.js +33 -16
  56. package/dist/unstable/Spine.js.map +1 -1
  57. package/package.json +1 -1
  58. package/src/BaseValue.ts +2 -0
  59. package/src/Batch.ts +19 -6
  60. package/src/DefaultTransition.ts +53 -2
  61. package/src/FrameLoop.ts +6 -2
  62. package/src/Machine.ts +7 -3
  63. package/src/Spring.ts +16 -0
  64. package/src/UnitScale.ts +56 -0
  65. package/src/index.ts +1 -0
  66. package/src/internal/frameLoop.ts +5 -5
  67. package/src/unstable/BatchCalls.ts +401 -0
  68. package/src/unstable/FrameEffects.ts +172 -0
  69. package/src/unstable/FrameTime.ts +1 -5
  70. package/src/unstable/Imperative.ts +1045 -0
  71. package/src/unstable/RetargetLegs.ts +20 -11
  72. package/src/unstable/Spine.ts +39 -18
@@ -0,0 +1,59 @@
1
+ /**
2
+ * An Environment's **Frame effects** (CONTEXT.md): an app's own code, run at the end of each frame the
3
+ * Environment draws, after Wardic's writes for it, in the order the effects were added. A scene runs
4
+ * them in its Host loop before it renders; the DOM before paint. The Environment calls {@link
5
+ * FrameEffects.run} at its frame's end, and gives `make` its way to ask for a frame, so an effect whose
6
+ * inputs changed is run on a frame nothing else asked for.
7
+ *
8
+ * @example
9
+ * import * as FrameEffects from "@wardic/core/unstable/FrameEffects"
10
+ *
11
+ * const effects = FrameEffects.make({ requestFrame: () => host.wantFrame(), report: console.error })
12
+ * const remove = effects.add((time) => controls.update())
13
+ * effects.run(time) // the Environment's, at its frame's end
14
+ *
15
+ * Unstable, for Wardic's own packages: public, with no semver promise.
16
+ *
17
+ * @module
18
+ */
19
+ import * as Effect from "effect/Effect";
20
+ import type * as Scope from "effect/Scope";
21
+ import * as Clock from "../Clock.ts";
22
+ import * as FrameLoop from "../FrameLoop.ts";
23
+ import * as RefreshFrameSource from "../RefreshFrameSource.ts";
24
+ /** What an Environment gives its Frame effects. */
25
+ export interface FrameEffectsOptions {
26
+ /** Asks the Environment for a frame, whose end runs the effects. Called once a request, until the run. */
27
+ readonly requestFrame: () => void;
28
+ /** What an effect that throws reports: the rest of the frame's effects still run. */
29
+ readonly report: (defect: unknown) => void;
30
+ }
31
+ /** An Environment's Frame effects: an ordered list it runs at each frame's end. */
32
+ export interface FrameEffects {
33
+ /** Run `effect` at the end of each frame from now on, after those added before it. Returns its remover. */
34
+ readonly add: (effect: (time: number) => void) => () => void;
35
+ /** Ask for a frame whose end runs the effects, though nothing else asks for one: an input of one changed. */
36
+ readonly request: () => void;
37
+ /** Whether a frame is asked for: a `request()` since the last `run`. */
38
+ readonly requested: () => boolean;
39
+ /** The Environment's call at its frame's end, `time` in ms: every effect added before it, in order. */
40
+ readonly run: (time: number) => void;
41
+ }
42
+ /**
43
+ * An Environment's Frame effects, asking it for frames through `options.requestFrame`. An effect added
44
+ * while they run waits for the next frame's run, as a Refresh frame's callbacks do; one removed while
45
+ * they run, before its turn, isn't run.
46
+ */
47
+ export declare const make: (options: FrameEffectsOptions) => FrameEffects;
48
+ /**
49
+ * Frame effects for an Environment on core's Frame loop and Refresh frames, the DOM's: run at the end
50
+ * of each tick, after the tick's hooks added before them (the Flush gate's flush, so after Wardic's
51
+ * writes for the frame), and, on a frame with no tick, on a Refresh frame of their own that `request()`
52
+ * asks for, which a tick withdraws. For as long as the Scope is open.
53
+ *
54
+ * @example
55
+ * const effects = yield* FrameEffects.onFrameLoop((defect) => console.error(defect))
56
+ * effects.add(() => camera.lookAt(target))
57
+ */
58
+ export declare const onFrameLoop: (report: (defect: unknown) => void) => Effect.Effect<FrameEffects, never, FrameLoop.FrameLoop | RefreshFrameSource.RefreshFrameSource | Clock.Clock | Scope.Scope>;
59
+ //# sourceMappingURL=FrameEffects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FrameEffects.d.ts","sourceRoot":"","sources":["../../src/unstable/FrameEffects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AACpC,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,kBAAkB,MAAM,0BAA0B,CAAA;AAE9D,mDAAmD;AACnD,MAAM,WAAW,mBAAmB;IAClC,0GAA0G;IAC1G,QAAQ,CAAC,YAAY,EAAE,MAAM,IAAI,CAAA;IACjC,qFAAqF;IACrF,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;CAC3C;AAED,mFAAmF;AACnF,MAAM,WAAW,YAAY;IAC3B,2GAA2G;IAC3G,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,KAAK,MAAM,IAAI,CAAA;IAC5D,6GAA6G;IAC7G,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAA;IAC5B,wEAAwE;IACxE,QAAQ,CAAC,SAAS,EAAE,MAAM,OAAO,CAAA;IACjC,uGAAuG;IACvG,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CACrC;AAQD;;;;GAIG;AACH,eAAO,MAAM,IAAI,YAAa,mBAAmB,KAAG,YA+DnD,CAAA;AAED;;;;;;;;;GASG;AAGH,eAAO,MAAM,WAAW,WAAY,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,KAAG,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,KAAK,EAAE,SAAS,CAAC,SAAS,GAAG,kBAAkB,CAAC,kBAAkB,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAkCtL,CAAA"}
@@ -0,0 +1,142 @@
1
+ /**
2
+ * An Environment's **Frame effects** (CONTEXT.md): an app's own code, run at the end of each frame the
3
+ * Environment draws, after Wardic's writes for it, in the order the effects were added. A scene runs
4
+ * them in its Host loop before it renders; the DOM before paint. The Environment calls {@link
5
+ * FrameEffects.run} at its frame's end, and gives `make` its way to ask for a frame, so an effect whose
6
+ * inputs changed is run on a frame nothing else asked for.
7
+ *
8
+ * @example
9
+ * import * as FrameEffects from "@wardic/core/unstable/FrameEffects"
10
+ *
11
+ * const effects = FrameEffects.make({ requestFrame: () => host.wantFrame(), report: console.error })
12
+ * const remove = effects.add((time) => controls.update())
13
+ * effects.run(time) // the Environment's, at its frame's end
14
+ *
15
+ * Unstable, for Wardic's own packages: public, with no semver promise.
16
+ *
17
+ * @module
18
+ */
19
+ // Unstable: ADR-0071, decision 5. #882 (ADR-0073, *Amendment (#882)*, Q3): the slot for decision 19's Frame
20
+ // effects, one for every Environment. Not a phase of the Frame loop or of the gate: the loop ticks only
21
+ // while an animation runs, and the gate flushes only what was written, so a frame where an effect's only
22
+ // input moved (`createTime()`, an every-frame `controls.update()`) has neither.
23
+ import * as Effect from "effect/Effect";
24
+ import * as Clock from "../Clock.js";
25
+ import * as FrameLoop from "../FrameLoop.js";
26
+ import * as RefreshFrameSource from "../RefreshFrameSource.js";
27
+ /**
28
+ * An Environment's Frame effects, asking it for frames through `options.requestFrame`. An effect added
29
+ * while they run waits for the next frame's run, as a Refresh frame's callbacks do; one removed while
30
+ * they run, before its turn, isn't run.
31
+ */
32
+ export const make = (options) => {
33
+ const { requestFrame, report } = options;
34
+ // In order: the per-frame path, a plain array and loops, nothing allocated a frame.
35
+ const entries = [];
36
+ let running = false;
37
+ let removedInRun = 0;
38
+ let asked = false;
39
+ /** The entries no longer live taken out, in place, keeping the rest's order. */
40
+ const compact = () => {
41
+ let kept = 0;
42
+ for (let i = 0; i < entries.length; i++) {
43
+ const entry = entries[i];
44
+ if (entry.live)
45
+ entries[kept++] = entry;
46
+ }
47
+ entries.length = kept;
48
+ };
49
+ const add = (effect) => {
50
+ const entry = { effect, live: true };
51
+ entries.push(entry);
52
+ return () => {
53
+ if (!entry.live)
54
+ return;
55
+ entry.live = false;
56
+ if (running) {
57
+ removedInRun++;
58
+ return;
59
+ }
60
+ compact();
61
+ };
62
+ };
63
+ const request = () => {
64
+ if (asked)
65
+ return;
66
+ asked = true;
67
+ requestFrame();
68
+ };
69
+ const run = (time) => {
70
+ asked = false;
71
+ running = true;
72
+ // Those added before the run: one added in it waits for the next frame.
73
+ const count = entries.length;
74
+ try {
75
+ for (let i = 0; i < count; i++) {
76
+ const entry = entries[i];
77
+ if (!entry.live)
78
+ continue;
79
+ try {
80
+ entry.effect(time);
81
+ }
82
+ catch (defect) {
83
+ report(defect);
84
+ }
85
+ }
86
+ }
87
+ finally {
88
+ running = false;
89
+ if (removedInRun > 0) {
90
+ removedInRun = 0;
91
+ compact();
92
+ }
93
+ }
94
+ };
95
+ return { add, request, requested: () => asked, run };
96
+ };
97
+ /**
98
+ * Frame effects for an Environment on core's Frame loop and Refresh frames, the DOM's: run at the end
99
+ * of each tick, after the tick's hooks added before them (the Flush gate's flush, so after Wardic's
100
+ * writes for the frame), and, on a frame with no tick, on a Refresh frame of their own that `request()`
101
+ * asks for, which a tick withdraws. For as long as the Scope is open.
102
+ *
103
+ * @example
104
+ * const effects = yield* FrameEffects.onFrameLoop((defect) => console.error(defect))
105
+ * effects.add(() => camera.lookAt(target))
106
+ */
107
+ // #884's PR 1 (ADR-0073 decision 19, *Amendment (#882)*'s Q3): the DOM's slot, as `@wardic/object`'s
108
+ // `frame(t)` runs its own. The tick's hook as the gate's `flushTicked` is: its own frame withdrawn, run now.
109
+ export const onFrameLoop = (report) => Effect.gen(function* () {
110
+ const loop = yield* FrameLoop.FrameLoop;
111
+ const { requestFrame, cancelFrame } = yield* RefreshFrameSource.RefreshFrameSource;
112
+ const clock = yield* Clock.Clock;
113
+ // The Refresh frame a request asked for, while it's pending.
114
+ let pending = false;
115
+ let frame = undefined;
116
+ const effects = make({
117
+ requestFrame: () => {
118
+ pending = true;
119
+ frame = requestFrame((time) => {
120
+ pending = false;
121
+ effects.run(time);
122
+ });
123
+ },
124
+ report,
125
+ });
126
+ const ticked = () => {
127
+ if (pending) {
128
+ cancelFrame(frame);
129
+ pending = false;
130
+ }
131
+ effects.run(clock.frameAt());
132
+ return undefined;
133
+ };
134
+ yield* loop.afterTick(ticked);
135
+ yield* Effect.addFinalizer(() => Effect.sync(() => {
136
+ if (pending)
137
+ cancelFrame(frame);
138
+ pending = false;
139
+ }));
140
+ return effects;
141
+ });
142
+ //# sourceMappingURL=FrameEffects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FrameEffects.js","sourceRoot":"","sources":["../../src/unstable/FrameEffects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,4GAA4G;AAC5G,wGAAwG;AACxG,yGAAyG;AACzG,gFAAgF;AAChF,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AACpC,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,kBAAkB,MAAM,0BAA0B,CAAA;AA4B9D;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,OAA4B,EAAgB,EAAE;IACjE,MAAM,EAAE,YAAY,EAAE,MAAM,E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AY,SAAS,CAAA;IAC9B,MAAM,OAAO,GAAiB,IAAI,CAAC;QACjC,YAAY,EAAE,GAAG,EAAE;YACjB,OAAO,GAAG,IAAI,CAAA;YACd,KAAK,GAAG,YAAY,CAAC,CAAC,IAAI,EAAE,EAAE;gBAC5B,OAAO,GAAG,KAAK,CAAA;gBACf,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YACnB,CAAC,CAAC,CAAA;QACJ,CAAC;QACD,MAAM;KACP,CAAC,CAAA;IACF,MAAM,MAAM,GAAG,GAAc,EAAE;QAC7B,IAAI,OAAO,EAAE,CAAC;YACZ,WAAW,CAAC,KAAK,CAAC,CAAA;YAClB,OAAO,GAAG,KAAK,CAAA;QACjB,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;QAC5B,OAAO,SAAS,CAAA;IAClB,CAAC,CAAA;IACD,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;IAC7B,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,CAC9B,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;QACf,IAAI,OAAO;YAAE,WAAW,CAAC,KAAK,CAAC,CAAA;QAC/B,OAAO,GAAG,KAAK,CAAA;IACjB,CAAC,CAAC,CACH,CAAA;IACD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAC,CAAA"}
@@ -1,12 +1,9 @@
1
1
  import type * as WardicServices from "./WardicServices.ts";
2
2
  /**
3
3
  * How long a key's velocity holds once nothing has moved it, in ms (Motion's `MAX_VELOCITY_DELTA`):
4
- * past it, the key is at rest. A velocity worked out from two frames further apart takes this as their
5
- * time apart.
4
+ * past it, the key is at rest. A velocity worked out over a longer step takes this as the step's time.
6
5
  */
7
6
  export declare const MAX_VELOCITY_DELTA = 30;
8
- /** A frame at 60 Hz, in ms: the time a leg's first frame is read over, from where it started (Motion's first-frame delta). */
9
- export declare const NOMINAL_FRAME: number;
10
7
  /**
11
8
  * The time now, in ms: the same for the rest of this synchronous block (core's `Clock.syncNow`).
12
9
  * Per frame: a check, and a read once a tick. A Snapshot's time until its spine gives it its
@@ -1 +1 @@
1
- {"version":3,"file":"FrameTime.d.ts","sourceRoot":"","sources":["../../src/unstable/FrameTime.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,KAAK,cAAc,MAAM,qBAAqB,CAAA;AAE1D;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,KAAK,CAAA;AAEpC,8HAA8H;AAC9H,eAAO,MAAM,aAAa,QAAY,CAAA;AAKtC;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAM,MAA+C,CAAA;AAM5E;;;GAGG;AACH,eAAO,MAAM,UAAU,YAAa,cAAc,CAAC,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC,KAAG,CAAC,MAAM,MAAM,CAMvG,CAAA"}
1
+ {"version":3,"file":"FrameTime.d.ts","sourceRoot":"","sources":["../../src/unstable/FrameTime.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,KAAK,cAAc,MAAM,qBAAqB,CAAA;AAE1D;;;GAGG;AACH,eAAO,MAAM,kBAAkB,KAAK,CAAA;AAKpC;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAM,MAA+C,CAAA;AAM5E;;;GAGG;AACH,eAAO,MAAM,UAAU,YAAa,cAAc,CAAC,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC,KAAG,CAAC,MAAM,MAAM,CAMvG,CAAA"}
@@ -15,12 +15,9 @@ import * as Effect from "effect/Effect";
15
15
  import * as Predicate from "effect/Predicate";
16
16
  /**
17
17
  * How long a key's velocity holds once nothing has moved it, in ms (Motion's `MAX_VELOCITY_DELTA`):
18
- * past it, the key is at rest. A velocity worked out from two frames further apart takes this as their
19
- * time apart.
18
+ * past it, the key is at rest. A velocity worked out over a longer step takes this as the step's time.
20
19
  */
21
20
  export const MAX_VELOCITY_DELTA = 30;
22
- /** A frame at 60 Hz, in ms: the time a leg's first frame is read over, from where it started (Motion's first-frame delta). */
23
- export const NOMINAL_FRAME = 1000 / 60;
24
21
  /**
25
22
  * The time now, in ms: the same for the rest of this synchronous block (core's `Clock.syncNow`).
26
23
  * Per frame: a check, and a read once a tick. A Snapshot's time until its spine gives it its
@@ -1 +1 @@
1
- {"version":3,"file":"FrameTime.js","sourceRoot":"","sources":["../../src/unstable/FrameTime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,iGAAiG;AACjG,sGAAsG;AACtG,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AACpC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAA;AAG7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAA;AAEpC,8HAA8H;AAC9H,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,GAAG,EAAE,CAAA;AAKtC;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAiB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,CAAA;AAE5E,+CAA+C;AAC/C,6EAA6E;AAC7E,MAAM,SAAS,GAAG,IAAI,OAAO,EAAsE,CAAA;AAEnG;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAA6D,EAAkB,EAAE;IAC1G,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IACnC,IAAI,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IAC/C,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IACnF,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IAC5B,OAAO,IAAI,CAAA;AACb,CAAC,CAAA"}
1
+ {"version":3,"file":"FrameTime.js","sourceRoot":"","sources":["../../src/unstable/FrameTime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,iGAAiG;AACjG,sGAAsG;AACtG,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AACpC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAA;AAG7C;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAA;AAKpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAiB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,CAAA;AAE5E,+CAA+C;AAC/C,6EAA6E;AAC7E,MAAM,SAAS,GAAG,IAAI,OAAO,EAAsE,CAAA;AAEnG;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAA6D,EAAkB,EAAE;IAC1G,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IACnC,IAAI,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IAC/C,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IACnF,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IAC5B,OAAO,IAAI,CAAA;AACb,CAAC,CAAA"}
@@ -0,0 +1,270 @@
1
+ /**
2
+ * **Imperative animation** (#433, CONTEXT.md; Motion's `animate`), for every Environment: an
3
+ * **Animation scope**'s `animate`, the Subjects it animates, and the **Playback controls** it returns.
4
+ * An Environment says what its Subjects are and how a plain one starts ({@link Subjects}), and what
5
+ * its Batches are ({@link Batches}); each binding's `createAnimate()` builds on it.
6
+ *
7
+ * - **A Wardic element** animates through its own spine, registered here while it's mounted: the
8
+ * call takes the keys it animates, which stay where it leaves them until the element's own target
9
+ * for them changes (Motion's latest-wins).
10
+ * - **A plain Subject** animates through a spine of its own (#433's Q4), with no config, presence or
11
+ * layout node: it starts from the Subject's Own value (ADR-0022) and keeps its values for the next
12
+ * call, velocity included. It's in the gate only while it animates, so the gate keeps nothing of a
13
+ * Subject it isn't animating.
14
+ * - **The controls** are Motion's (`AnimationPlaybackControls`): awaitable, with `stop`, `cancel`,
15
+ * `complete`, `pause`, `play`, `speed`, `time` and `duration`, every Subject's legs run through one
16
+ * `Playback.Playhead`. Its `finished` resolves at a landing or `complete()`, never at a `stop()` or a
17
+ * `cancel()`, as Motion's.
18
+ * - **A sequence** (#433's PR 2, Motion's) is compiled by core's `Sequence` to each Subject's
19
+ * Keyframes over the whole sequence, run on the same controls: each Subject animates as a call
20
+ * does, and a function Segment's value, from 0, is told to its callback each frame.
21
+ *
22
+ * Unstable, for Wardic's own packages: public, with no semver promise.
23
+ *
24
+ * @module
25
+ */
26
+ import type * as DefaultTransition from "../DefaultTransition.ts";
27
+ import * as Playback from "../Playback.ts";
28
+ import * as ReducedMotion from "../ReducedMotion.ts";
29
+ import * as Sequence from "../Sequence.ts";
30
+ import type * as Config from "./Config.ts";
31
+ import type * as FlushGate from "./FlushGate.ts";
32
+ import type * as MeasuredPairs from "./MeasuredPairs.ts";
33
+ import type * as OwnValues from "./OwnValues.ts";
34
+ import * as Spine from "./Spine.ts";
35
+ import type * as VariableValues from "./VariableValues.ts";
36
+ import type * as WardicServices from "./WardicServices.ts";
37
+ /** What an Imperative animation animates a Wardic element through: what its spine hands over (`host`). */
38
+ type Animatable = Pick<Spine.ElementSpine, "host">;
39
+ /**
40
+ * Register a mounted Wardic element's spine for the Imperative animations of its Subject (#433): until
41
+ * the returned function, which its unmount calls.
42
+ */
43
+ export declare const registerAnimatable: (subject: object, spine: Animatable) => (() => void);
44
+ /** What a scope animates plain Subjects with: its provider's. */
45
+ export interface AnimateEnv {
46
+ readonly runtime: WardicServices.Runner<WardicServices.WardicServices>;
47
+ readonly gate: FlushGate.Shape;
48
+ readonly reducedMotion: () => boolean;
49
+ /**
50
+ * Whether its animations are skipped (#468): its scope's nearest `WardicConfig`'s, read as each
51
+ * starts, and handed to each Subject's animation in its transition, as Motion's `useAnimate` does.
52
+ */
53
+ readonly skipAnimations: () => boolean;
54
+ readonly positionalKeys: ReducedMotion.PositionalKeys["Service"];
55
+ readonly defaultTransition: DefaultTransition.DefaultTransition["Service"];
56
+ /** Its Environment's reads of its Subjects' own values (#672). */
57
+ readonly ownValues: OwnValues.Shape;
58
+ /** Its Environment's Measured pairs (#430, #672). */
59
+ readonly measuredPairs: MeasuredPairs.Shape;
60
+ /** Its Environment's Variable values (#55, #672). */
61
+ readonly variableValues: VariableValues.Shape;
62
+ }
63
+ /**
64
+ * An Environment's Subjects, for `animate`: what its first argument names, and where a plain one
65
+ * starts. The DOM's are elements, selectors looked up in the scope and lists of them; a scene's, its
66
+ * objects.
67
+ */
68
+ export interface Subjects<S extends object> {
69
+ /** The Subjects `given` names, inside `scope` (a binding's scope, or `undefined`): none when it names none. */
70
+ readonly resolve: (given: unknown, scope: unknown) => ReadonlyArray<S>;
71
+ /** A plain Subject's Base-value links (ADR-0022): its Own values, and the DOM's Starting style. */
72
+ readonly startLinksOf: (subject: S) => Spine.StartLinks;
73
+ }
74
+ /** What `animate` asks of a Batch's binding (#665): its tracks, and its Segments in a sequence. */
75
+ export interface BatchCalls {
76
+ /** An `animate` call's track over its members, or the members `members` names, driven by `head`. */
77
+ track(call: BatchCall): Spine.ImperativeTrack;
78
+ /** The members a Batch or a member's handle names: `undefined` for every member, none once a handle's member has left. */
79
+ namedOf(entry: BatchEntry): ReadonlyArray<number> | undefined;
80
+ /** A sequence's Segment of the Batch, or of the members `named` names: its members' entries, in member order, and its values for core. */
81
+ segmentOf(named: ReadonlyArray<number> | undefined, target: Readonly<Record<string, unknown>>): {
82
+ readonly subjects: ReadonlyArray<BatchMember>;
83
+ readonly values: Readonly<Record<string, Sequence.Value>>;
84
+ };
85
+ /** A sequence's track over its members, each through its own Batch keys' stops, driven by `head`. */
86
+ sequenceTrack(call: BatchSequenceCall): Spine.ImperativeTrack;
87
+ }
88
+ /** What `animate` knows of a Batch or a member's handle: its binding, and a handle's member by its index. */
89
+ export interface BatchEntry {
90
+ readonly binding: BatchCalls;
91
+ readonly member: number | undefined;
92
+ }
93
+ /** A member's entry: a member's handle's, or a member's Subject's. */
94
+ export interface BatchMember extends BatchEntry {
95
+ readonly member: number;
96
+ }
97
+ /** An `animate` call of a Batch: its targets, its transition, its scope's settings, its Playhead and landing. */
98
+ export interface BatchCall {
99
+ readonly target: Readonly<Record<string, unknown>>;
100
+ readonly transition: Config.WardicTransition | undefined;
101
+ readonly reducedMotion: boolean;
102
+ readonly skipAnimations: boolean;
103
+ readonly head: Playback.Playhead;
104
+ readonly settled: () => void;
105
+ /** The members it moves, in order: every member when left out. */
106
+ readonly members: ReadonlyArray<number> | undefined;
107
+ }
108
+ /** A sequence's part for a Batch: its members, in order, each one's compiled animation, its scope's settings, its Playhead and landing. */
109
+ export interface BatchSequenceCall {
110
+ readonly members: ReadonlyArray<number>;
111
+ readonly animations: ReadonlyArray<Sequence.Animation>;
112
+ readonly reducedMotion: boolean;
113
+ readonly skipAnimations: boolean;
114
+ readonly head: Playback.Playhead;
115
+ readonly settled: () => void;
116
+ }
117
+ /** An `animate` call's parts for Subjects that are Batch members' (#665): each Batch's members, and each Subject's own keys. */
118
+ export interface CallParts<S extends object> {
119
+ readonly members: ReadonlyArray<{
120
+ readonly binding: BatchCalls;
121
+ readonly members: ReadonlyArray<number>;
122
+ readonly target: Readonly<Record<string, unknown>>;
123
+ }>;
124
+ readonly subjects: ReadonlyArray<{
125
+ readonly subject: S;
126
+ readonly index: number;
127
+ readonly target: object;
128
+ }>;
129
+ }
130
+ /** A compiled sequence's part for one Batch: its members, in the order they first appear, and each one's animation. */
131
+ export interface SequencePart {
132
+ readonly binding: BatchCalls;
133
+ readonly members: ReadonlyArray<number>;
134
+ readonly animations: ReadonlyArray<Sequence.Animation>;
135
+ }
136
+ /** An Environment's Batches, for `animate`: its handles, and the Subjects that are its members'. */
137
+ export interface Batches<S extends object> {
138
+ /** The Batch or member handle `given` is: `undefined` for anything else. */
139
+ entryOf(given: unknown): BatchEntry | undefined;
140
+ /** Whether any of `subjects` is a Batch member's: when none is, a call keeps the plain path. */
141
+ hasMembers(subjects: ReadonlyArray<S>): boolean;
142
+ /** A call's parts, when some of `subjects` are members': each Batch's members as one part, with its keys. */
143
+ callPartsOf(subjects: ReadonlyArray<S>, target: object): CallParts<S>;
144
+ /** A Segment's subjects: each member's as its member's entry, each Batch checking the Segment's values once. */
145
+ segmentSubjectsOf(subjects: ReadonlyArray<S>, target: Readonly<Record<string, unknown>>): ReadonlyArray<S | BatchMember>;
146
+ /** A compiled sequence's parts: each Batch's members as one part, the other keys of a member's its Subject's. */
147
+ sequencePartsOf<X>(compiled: ReadonlyArray<readonly [X | BatchMember, Sequence.Animation]>): {
148
+ readonly batches: ReadonlyArray<SequencePart>;
149
+ readonly others: ReadonlyArray<readonly [X | S, Sequence.Animation]>;
150
+ };
151
+ }
152
+ /** An Environment with no Batches. */
153
+ export declare const noBatches: Batches<object>;
154
+ /** What `animate` works with: its Environment's Subjects and Batches. */
155
+ export interface Ports<S extends object> {
156
+ readonly subjects: Subjects<S>;
157
+ readonly batches: Batches<S>;
158
+ }
159
+ /** A transition without its `delay`, each arm: `animate`'s and a Segment's take their own. */
160
+ type WithoutDelay = Config.WardicTransition extends infer T ? (T extends unknown ? {
161
+ readonly [K in keyof T as Exclude<K, "delay">]: T[K];
162
+ } : never) : never;
163
+ /** A `delay` that may be each Subject's (Motion's `delay(i, n)`; `stagger()` is #436). */
164
+ interface EachDelay {
165
+ readonly delay?: number | ((index: number, count: number) => number) | undefined;
166
+ }
167
+ /**
168
+ * `animate`'s options: a transition, its `delay` a number, or a function of each Subject's index and
169
+ * their count, such as `stagger(0.05)`; and `onComplete`, called as it lands. Motion's.
170
+ */
171
+ export type WardicAnimateOptions = WithoutDelay & EachDelay & {
172
+ readonly onComplete?: (() => void) | undefined;
173
+ };
174
+ /** Where an animation is: `"idle"`, `"running"`, `"paused"` or `"finished"`. Motion's `AnimationPlayState`. */
175
+ export type WardicPlayState = "idle" | "running" | "paused" | "finished";
176
+ /**
177
+ * What `animate` returns: an animation's controls, and a promise of its landing, so it can be awaited.
178
+ * Motion's `AnimationPlaybackControls`.
179
+ */
180
+ export interface WardicPlaybackControls extends PromiseLike<void> {
181
+ /** Seconds played, a delay included. Set, it seeks: each key starts again there, holding while paused. */
182
+ time: number;
183
+ /** How fast it plays: 1 as given, 2 twice as fast, 0 held, below 0 backwards. */
184
+ speed: number;
185
+ /** How long it runs, in seconds: its longest Subject's longest key, a spring's to rest. */
186
+ readonly duration: number;
187
+ readonly state: WardicPlayState;
188
+ /** Resolves when it lands, or at `complete()`; never at `stop()` or `cancel()`, as Motion's. */
189
+ readonly finished: Promise<void>;
190
+ /** Play it on: from where it's paused, or again from its start once it's finished or cancelled. Not after `stop()`. */
191
+ readonly play: () => void;
192
+ /** Hold it where it is. */
193
+ readonly pause: () => void;
194
+ /** End it where it is, for good: its keys stay there. */
195
+ readonly stop: () => void;
196
+ /** End it, and put its keys back where it started them. */
197
+ readonly cancel: () => void;
198
+ /** Go to its end at once, and finish. */
199
+ readonly complete: () => void;
200
+ }
201
+ /** What a scope hears of its animations: each one's start and its end, however it ended. */
202
+ export interface AnimationWatch {
203
+ readonly started: (controls: WardicPlaybackControls) => void;
204
+ /** It's no longer in flight: `landed` when it finished. */
205
+ readonly ended: (controls: WardicPlaybackControls, landed: boolean) => void;
206
+ }
207
+ /** An animation of no Subject: finished at once (a server's, or a subject that matched none). */
208
+ export declare const finishedControls: () => WardicPlaybackControls;
209
+ /**
210
+ * Where a Segment starts in a sequence: seconds in, `1.5`; after or before the end of the Segment
211
+ * before, `"+0.5"` or `"-0.5"`; at its start, `"<"`, or around it, `"<+0.5"` or `"<-0.5"`; or a label's
212
+ * name. Motion's `SequenceTime`.
213
+ */
214
+ export type WardicSequenceTime = number | "<" | `+${number}` | `-${number}` | `<+${number}` | `<-${number}` | (string & {});
215
+ /** A label in a sequence: a name for where the Segment before ends, or `{ name, at }` for a time of its own. Motion's. */
216
+ export type WardicSequenceLabel = string | {
217
+ readonly name: string;
218
+ readonly at: WardicSequenceTime;
219
+ };
220
+ /**
221
+ * A Segment's options: a transition, with a value's own entries laid over it; its `delay`, a number or
222
+ * a function of each Subject's index and count, such as `stagger(0.05)`; and `at`, where it starts. A
223
+ * spring through two stops or fewer plays as an easing over its time to rest. Motion's.
224
+ */
225
+ export type WardicSegmentOptions = WithoutDelay & EachDelay & {
226
+ readonly at?: WardicSequenceTime | undefined;
227
+ };
228
+ /** A Segment's values: each a value or a list of keyframes, as a target's. */
229
+ export type WardicSegmentTarget = Omit<Config.WardicTargetValues, "transition">;
230
+ /**
231
+ * A function Segment, `[callback, value?, options?]`: its callback is given a value each frame, from 0
232
+ * to 1 unless it gives its own stops, for what isn't a Subject's own value. Motion's, in place of its
233
+ * motion value Segments.
234
+ */
235
+ export type WardicFunctionSegment = readonly [callback: (value: number) => void] | readonly [callback: (value: number) => void, options: WardicSegmentOptions] | readonly [callback: (value: number) => void, value: number | Config.WardicKeyframes<number>, options: WardicSegmentOptions] | readonly [callback: (value: string) => void, value: string | Config.WardicKeyframes<string>, options: WardicSegmentOptions];
236
+ /**
237
+ * A sequence's options: `duration`, the whole sequence scaled to it; `delay`; `repeat`, `repeatType`
238
+ * and `repeatDelay`; `defaultTransition`, each Segment's when it gives none (a 0.3 s `easeOut` tween
239
+ * otherwise); and `onComplete`, called as it lands. Motion's `SequenceOptions`.
240
+ */
241
+ export interface WardicSequenceOptions {
242
+ readonly duration?: number | undefined;
243
+ readonly delay?: number | undefined;
244
+ readonly repeat?: number | undefined;
245
+ readonly repeatType?: "loop" | "reverse" | "mirror" | undefined;
246
+ readonly repeatDelay?: number | undefined;
247
+ readonly defaultTransition?: Config.WardicTransition | undefined;
248
+ readonly onComplete?: (() => void) | undefined;
249
+ }
250
+ /**
251
+ * An **Animation scope**'s `animate` (#433), over an Environment's {@link Ports}: `animate(subject,
252
+ * target, options?)`, a Batch's `animate(batch, target, options?)` and `animate(sequence, options?)`,
253
+ * each returning its Playback controls. `scope()` is handed to the Environment's {@link Subjects.resolve}
254
+ * (the DOM's selectors are looked up inside it); each animation is told to `watch` as it starts and
255
+ * ends. Every Subject's legs start in the call, on the loop by the end of its task. An Environment
256
+ * types its own overloads over it.
257
+ */
258
+ export declare const make: <S extends object>(env: AnimateEnv, ports: Ports<S>, scope: () => unknown, watch: AnimationWatch) => (first: unknown, second?: unknown, third?: WardicAnimateOptions) => WardicPlaybackControls;
259
+ /** Whether `given` is a sequence rather than a subject (#433, Motion's `isSequence`): a list with a Segment, itself a list, in it; a list of Subjects has none. A binding whose `animate` is its own tells the forms apart by it (#798). */
260
+ export declare const isSequence: (given: unknown) => given is ReadonlyArray<unknown>;
261
+ /**
262
+ * Whether a Segment animates anything under `scope` (#798): a function Segment does, and a Batch's; a
263
+ * Segment of Subjects when its subject names one; a label (a string, or `{ name, at }`) never. What a
264
+ * binding asks of a sequence before it plays it, since one that animates nothing lands at once.
265
+ */
266
+ export declare const segmentAnimates: <S extends object>(ports: Ports<S>, segment: unknown, scope: unknown) => boolean;
267
+ /** `watch`, with `also` told each start and end after it, when given: a scope's own watch beside its owner's (#433), a binding's beside a scope's (#798). */
268
+ export declare const alsoTold: (watch: AnimationWatch, also: AnimationWatch | undefined) => AnimationWatch;
269
+ export {};
270
+ //# sourceMappingURL=Imperative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Imperative.d.ts","sourceRoot":"","sources":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