@wardic/core 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Arc.d.ts +2 -2
- package/dist/Arc.js +1 -1
- package/dist/BaseValue.d.ts +11 -10
- package/dist/BaseValue.d.ts.map +1 -1
- package/dist/BaseValue.js +12 -15
- package/dist/BaseValue.js.map +1 -1
- package/dist/Batch.d.ts +12 -6
- package/dist/Batch.d.ts.map +1 -1
- package/dist/Batch.js +374 -30
- package/dist/Batch.js.map +1 -1
- package/dist/Clock.d.ts +16 -0
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +22 -8
- package/dist/Clock.js.map +1 -1
- package/dist/DefaultTransition.d.ts +3 -2
- package/dist/DefaultTransition.d.ts.map +1 -1
- package/dist/DefaultTransition.js +5 -3
- package/dist/DefaultTransition.js.map +1 -1
- package/dist/Drag.d.ts +24 -9
- package/dist/Drag.d.ts.map +1 -1
- package/dist/Drag.js +10 -10
- package/dist/Drag.js.map +1 -1
- package/dist/DragActivity.js +3 -3
- package/dist/DragRecognizer.d.ts +14 -8
- package/dist/DragRecognizer.d.ts.map +1 -1
- package/dist/DragRecognizer.js +93 -34
- package/dist/DragRecognizer.js.map +1 -1
- package/dist/Easing.d.ts +1 -1
- package/dist/Easing.js +1 -1
- package/dist/Frame.d.ts.map +1 -1
- package/dist/Frame.js +5 -3
- package/dist/Frame.js.map +1 -1
- package/dist/InputFeed.d.ts +11 -8
- package/dist/InputFeed.d.ts.map +1 -1
- package/dist/InputFeed.js +18 -37
- package/dist/InputFeed.js.map +1 -1
- package/dist/InputSource.d.ts +3 -3
- package/dist/InputSource.js +2 -2
- package/dist/Interpolator.d.ts +2 -2
- package/dist/Interpolator.js +2 -2
- package/dist/InterpolatorRegistry.d.ts +29 -15
- package/dist/InterpolatorRegistry.d.ts.map +1 -1
- package/dist/InterpolatorRegistry.js +17 -8
- package/dist/InterpolatorRegistry.js.map +1 -1
- package/dist/LiveValue.d.ts +16 -9
- package/dist/LiveValue.d.ts.map +1 -1
- package/dist/LiveValue.js +204 -27
- package/dist/LiveValue.js.map +1 -1
- package/dist/Machine.d.ts +21 -8
- package/dist/Machine.d.ts.map +1 -1
- package/dist/Machine.js +184 -60
- package/dist/Machine.js.map +1 -1
- package/dist/Playback.d.ts.map +1 -1
- package/dist/Playback.js +16 -9
- package/dist/Playback.js.map +1 -1
- package/dist/Projection.d.ts +9 -9
- package/dist/Projection.js +2 -2
- package/dist/Recognizer.d.ts +2 -2
- package/dist/Recognizer.d.ts.map +1 -1
- package/dist/Recognizer.js +15 -10
- package/dist/Recognizer.js.map +1 -1
- package/dist/ReducedMotion.d.ts +4 -4
- package/dist/ReducedMotion.js +6 -6
- package/dist/Renderer.d.ts +5 -5
- package/dist/Renderer.js +6 -6
- package/dist/Renderer.js.map +1 -1
- package/dist/Reorder.d.ts +1 -1
- package/dist/Reorder.d.ts.map +1 -1
- package/dist/Reorder.js +2 -1
- package/dist/Reorder.js.map +1 -1
- package/dist/ScrollSource.d.ts +1 -1
- package/dist/ScrollSource.d.ts.map +1 -1
- package/dist/Sequence.d.ts +1 -1
- package/dist/SharedSource.d.ts +3 -3
- package/dist/SharedSource.js +5 -5
- package/dist/SharedSource.js.map +1 -1
- package/dist/Spring.d.ts.map +1 -1
- package/dist/Spring.js +2 -1
- package/dist/Spring.js.map +1 -1
- package/dist/Values.d.ts +2 -2
- package/dist/Values.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/carried.d.ts +13 -0
- package/dist/internal/carried.d.ts.map +1 -0
- package/dist/internal/carried.js +23 -0
- package/dist/internal/carried.js.map +1 -0
- package/dist/internal/firstSteps.d.ts +66 -0
- package/dist/internal/firstSteps.d.ts.map +1 -0
- package/dist/internal/firstSteps.js +107 -0
- package/dist/internal/firstSteps.js.map +1 -0
- package/dist/internal/frameLoop.d.ts +11 -3
- package/dist/internal/frameLoop.d.ts.map +1 -1
- package/dist/internal/frameLoop.js +190 -39
- package/dist/internal/frameLoop.js.map +1 -1
- package/dist/internal/guarded.d.ts +16 -0
- package/dist/internal/guarded.d.ts.map +1 -0
- package/dist/internal/guarded.js +68 -0
- package/dist/internal/guarded.js.map +1 -0
- package/dist/internal/lerpsNumbers.d.ts +11 -0
- package/dist/internal/lerpsNumbers.d.ts.map +1 -0
- package/dist/internal/lerpsNumbers.js +38 -0
- package/dist/internal/lerpsNumbers.js.map +1 -0
- package/dist/internal/options.d.ts +7 -7
- package/dist/internal/options.d.ts.map +1 -1
- package/dist/internal/options.js +10 -10
- package/dist/internal/options.js.map +1 -1
- package/dist/internal/stepper.d.ts +21 -4
- package/dist/internal/stepper.d.ts.map +1 -1
- package/dist/internal/stepper.js +21 -5
- package/dist/internal/stepper.js.map +1 -1
- package/dist/internal/tracing.d.ts +1 -1
- package/dist/internal/tracing.js +1 -1
- package/dist/unstable/AnimationControls.d.ts +45 -39
- package/dist/unstable/AnimationControls.d.ts.map +1 -1
- package/dist/unstable/AnimationControls.js +59 -35
- package/dist/unstable/AnimationControls.js.map +1 -1
- package/dist/unstable/AppearHandoff.d.ts +11 -5
- package/dist/unstable/AppearHandoff.d.ts.map +1 -1
- package/dist/unstable/AppearHandoff.js.map +1 -1
- package/dist/unstable/BatchCalls.d.ts +2 -2
- package/dist/unstable/BatchCalls.js +5 -5
- package/dist/unstable/Config.d.ts +21 -17
- package/dist/unstable/Config.d.ts.map +1 -1
- package/dist/unstable/Config.js.map +1 -1
- package/dist/unstable/FirstSteps.d.ts +25 -0
- package/dist/unstable/FirstSteps.d.ts.map +1 -0
- package/dist/unstable/FirstSteps.js +2 -0
- package/dist/unstable/FirstSteps.js.map +1 -0
- package/dist/unstable/FlushGate.d.ts +54 -50
- package/dist/unstable/FlushGate.d.ts.map +1 -1
- package/dist/unstable/FlushGate.js +201 -77
- package/dist/unstable/FlushGate.js.map +1 -1
- package/dist/unstable/FrameEffects.d.ts +6 -3
- package/dist/unstable/FrameEffects.d.ts.map +1 -1
- package/dist/unstable/FrameEffects.js +14 -3
- package/dist/unstable/FrameEffects.js.map +1 -1
- package/dist/unstable/FrameTime.d.ts +1 -1
- package/dist/unstable/FrameTime.js +1 -1
- package/dist/unstable/Imperative.d.ts +42 -13
- package/dist/unstable/Imperative.d.ts.map +1 -1
- package/dist/unstable/Imperative.js +279 -88
- package/dist/unstable/Imperative.js.map +1 -1
- package/dist/unstable/MeasuredPairs.d.ts +6 -2
- package/dist/unstable/MeasuredPairs.d.ts.map +1 -1
- package/dist/unstable/MeasuredPairs.js.map +1 -1
- package/dist/unstable/OwnValues.js +1 -1
- package/dist/unstable/PresenceRecord.d.ts +30 -26
- package/dist/unstable/PresenceRecord.d.ts.map +1 -1
- package/dist/unstable/PresenceRecord.js +8 -8
- package/dist/unstable/PresenceRecord.js.map +1 -1
- package/dist/unstable/Projector.d.ts +34 -0
- package/dist/unstable/Projector.d.ts.map +1 -0
- package/dist/unstable/Projector.js +9 -0
- package/dist/unstable/Projector.js.map +1 -0
- package/dist/unstable/Report.d.ts +8 -1
- package/dist/unstable/Report.d.ts.map +1 -1
- package/dist/unstable/Report.js +18 -2
- package/dist/unstable/Report.js.map +1 -1
- package/dist/unstable/RetargetLegs.d.ts +7 -1
- package/dist/unstable/RetargetLegs.d.ts.map +1 -1
- package/dist/unstable/RetargetLegs.js +24 -8
- package/dist/unstable/RetargetLegs.js.map +1 -1
- package/dist/unstable/Spine.d.ts +123 -68
- package/dist/unstable/Spine.d.ts.map +1 -1
- package/dist/unstable/Spine.js +319 -167
- package/dist/unstable/Spine.js.map +1 -1
- package/dist/unstable/Stops.d.ts +3 -3
- package/dist/unstable/Stops.js +4 -4
- package/dist/unstable/Subject.d.ts +2 -2
- package/dist/unstable/Subject.js +2 -2
- package/dist/unstable/Timelines.d.ts +11 -11
- package/dist/unstable/Timelines.d.ts.map +1 -1
- package/dist/unstable/Timelines.js +3 -3
- package/dist/unstable/VariantTarget.d.ts +32 -10
- package/dist/unstable/VariantTarget.d.ts.map +1 -1
- package/dist/unstable/VariantTarget.js +73 -20
- package/dist/unstable/VariantTarget.js.map +1 -1
- package/dist/unstable/VariantTree.d.ts +68 -34
- package/dist/unstable/VariantTree.d.ts.map +1 -1
- package/dist/unstable/VariantTree.js +83 -36
- package/dist/unstable/VariantTree.js.map +1 -1
- package/dist/unstable/WardicConfigValue.d.ts +13 -13
- package/dist/unstable/WardicConfigValue.d.ts.map +1 -1
- package/dist/unstable/WardicConfigValue.js +4 -4
- package/dist/unstable/WardicConfigValue.js.map +1 -1
- package/package.json +1 -1
- package/src/Arc.ts +3 -3
- package/src/BaseValue.ts +18 -21
- package/src/Batch.ts +391 -27
- package/src/Clock.ts +29 -8
- package/src/DefaultTransition.ts +5 -3
- package/src/Drag.ts +32 -14
- package/src/DragActivity.ts +3 -3
- package/src/DragRecognizer.ts +118 -41
- package/src/Easing.ts +1 -1
- package/src/Frame.ts +5 -3
- package/src/InputFeed.ts +39 -42
- package/src/InputSource.ts +5 -5
- package/src/Interpolator.ts +3 -3
- package/src/InterpolatorRegistry.ts +22 -13
- package/src/LiveValue.ts +186 -30
- package/src/Machine.ts +252 -81
- package/src/Playback.ts +15 -9
- package/src/Projection.ts +9 -9
- package/src/Recognizer.ts +16 -10
- package/src/ReducedMotion.ts +6 -6
- package/src/Renderer.ts +6 -6
- package/src/Reorder.ts +3 -2
- package/src/ScrollSource.ts +1 -1
- package/src/Sequence.ts +1 -1
- package/src/SharedSource.ts +5 -5
- package/src/Spring.ts +2 -1
- package/src/Values.ts +2 -2
- package/src/index.ts +1 -1
- package/src/internal/carried.ts +22 -0
- package/src/internal/firstSteps.ts +139 -0
- package/src/internal/frameLoop.ts +203 -41
- package/src/internal/guarded.ts +69 -0
- package/src/internal/lerpsNumbers.ts +53 -0
- package/src/internal/options.ts +10 -10
- package/src/internal/stepper.ts +33 -6
- package/src/internal/tracing.ts +1 -1
- package/src/unstable/AnimationControls.ts +88 -57
- package/src/unstable/AppearHandoff.ts +13 -6
- package/src/unstable/BatchCalls.ts +5 -5
- package/src/unstable/Config.ts +23 -17
- package/src/unstable/FirstSteps.ts +26 -0
- package/src/unstable/FlushGate.ts +250 -108
- package/src/unstable/FrameEffects.ts +17 -4
- package/src/unstable/FrameTime.ts +1 -1
- package/src/unstable/Imperative.ts +342 -101
- package/src/unstable/MeasuredPairs.ts +7 -1
- package/src/unstable/OwnValues.ts +1 -1
- package/src/unstable/PresenceRecord.ts +33 -29
- package/src/unstable/Projector.ts +45 -0
- package/src/unstable/Report.ts +20 -2
- package/src/unstable/RetargetLegs.ts +24 -9
- package/src/unstable/Spine.ts +399 -202
- package/src/unstable/Stops.ts +6 -6
- package/src/unstable/Subject.ts +2 -2
- package/src/unstable/Timelines.ts +12 -12
- package/src/unstable/VariantTarget.ts +102 -23
- package/src/unstable/VariantTree.ts +123 -42
- package/src/unstable/WardicConfigValue.ts +13 -13
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
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
|
|
4
|
-
*
|
|
3
|
+
* one object made outside any component and given as `animate={controls}` to any number of Wards'
|
|
4
|
+
* Subjects, which follow its calls.
|
|
5
5
|
*
|
|
6
|
-
* - **`start(definition, transitionOverride)`** sets each
|
|
6
|
+
* - **`start(definition, transitionOverride)`** sets each Subject's `animate` entry (a **Controls
|
|
7
7
|
* change**), so it Retargets, staggers its Variant children and lands as a change of the prop would.
|
|
8
|
-
* It resolves once each
|
|
9
|
-
* - The override is the transition of that change: it beats the definition's own on the
|
|
8
|
+
* It resolves once each Subject 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 Subject and
|
|
10
10
|
* on each Variant child, and it is their orchestration (stagger, `when`), as Motion's
|
|
11
11
|
* `transitionOverride` is.
|
|
12
12
|
* - Their next Retarget, a gesture's, runs on their own transitions again.
|
|
13
|
-
* - **`set(definition)`** is an **Instant change**: the
|
|
13
|
+
* - **`set(definition)`** is an **Instant change**: the Subjects and their Variant children
|
|
14
14
|
* snap there, as Motion's `setValues` sets them.
|
|
15
|
-
* - **`stop()`** ends each
|
|
15
|
+
* - **`stop()`** ends each Ward's running legs where they are.
|
|
16
16
|
*
|
|
17
|
-
* A function definition is called once per
|
|
18
|
-
* Motion's `controls.start((i) => …)
|
|
17
|
+
* A function definition is called once per Subject, with its `custom`, values and velocities, as
|
|
18
|
+
* Motion's `controls.start((i) => …)`, every Subject's before any is set: one that throws for a Subject
|
|
19
|
+
* refuses the call, taking nothing. A Subject hears the controls from its mount to its unmount.
|
|
19
20
|
*
|
|
20
21
|
* Unstable, for Wardic's own packages: public, with no semver promise.
|
|
21
22
|
*
|
|
@@ -25,88 +26,93 @@ import type * as Values from "../Values.ts";
|
|
|
25
26
|
import * as Config from "./Config.ts";
|
|
26
27
|
export type { WardicAnimationControls, WardicControlsDefinition } from "./Config.ts";
|
|
27
28
|
/**
|
|
28
|
-
* A **Controls change** (#433): what one `start` or `set` set one
|
|
29
|
-
* transition it runs on, and the landings it waits for. The
|
|
29
|
+
* A **Controls change** (#433): what one `start` or `set` set one Subject's `animate` entry to, the
|
|
30
|
+
* transition it runs on, and the landings it waits for. The Subject and each Variant child it reaches
|
|
30
31
|
* join it at the Retarget it makes them run, and leave at that one's landing (or the next's).
|
|
31
32
|
*/
|
|
32
33
|
export interface ControlsChange {
|
|
33
34
|
/** Its place among every change: a trigger key part, so a change is a trigger even to the same name. */
|
|
34
35
|
readonly serial: number;
|
|
35
|
-
/** The
|
|
36
|
+
/** The Subject's `animate` entry: a target or a name, a resolver already called. */
|
|
36
37
|
readonly definition: Config.WardicVariant | Config.WardicVariantLabels;
|
|
37
|
-
/** The transition of the change (start's override, set's instant one), or none: the
|
|
38
|
+
/** The transition of the change (start's override, set's instant one), or none: the Subject's own. */
|
|
38
39
|
readonly override: Config.WardicTransition | undefined;
|
|
39
|
-
/**
|
|
40
|
+
/** Subjects in it that haven't landed. */
|
|
40
41
|
pending: number;
|
|
41
|
-
/** Whether every
|
|
42
|
+
/** Whether every Subject it reaches has had its chance to join: its binding's flush has run. */
|
|
42
43
|
armed: boolean;
|
|
43
44
|
/** Told once it has landed. */
|
|
44
45
|
readonly landed: () => void;
|
|
45
46
|
}
|
|
46
|
-
/** What a controlled
|
|
47
|
+
/** What a controlled Subject does at a change, as its binding wires it: its entry worked out, then set, and the change's landing promised. */
|
|
47
48
|
export interface Controlled {
|
|
48
|
-
|
|
49
|
+
/** Its entry for `definition`: a function definition called with its `custom`, values and velocities; anything else as it is. */
|
|
50
|
+
readonly entryOf: (definition: Config.WardicControlsDefinition) => Config.WardicVariant | Config.WardicVariantLabels;
|
|
51
|
+
readonly change: (entry: Config.WardicVariant | Config.WardicVariantLabels, override: Config.WardicTransition | undefined) => Promise<void>;
|
|
49
52
|
readonly stop: () => void;
|
|
50
53
|
}
|
|
51
54
|
/** `set`'s transition (#433, Motion's `setValues`): none to speak of, and no orchestration. */
|
|
52
55
|
export declare const INSTANT: Config.WardicTransition;
|
|
53
56
|
/**
|
|
54
|
-
* Makes animation controls, which animate
|
|
55
|
-
* to each
|
|
56
|
-
*
|
|
57
|
+
* Makes animation controls, which animate Subjects from code by their variants or targets: a binding
|
|
58
|
+
* gives them to each Subject as its `animate`, then `start`, `set` or `stop` them. Needs no owner.
|
|
59
|
+
* Motion's `useAnimationControls`.
|
|
57
60
|
*
|
|
58
61
|
* @example
|
|
59
62
|
* const controls = createAnimationControls()
|
|
60
|
-
*
|
|
63
|
+
* // A binding gives `controls` to each Subject as its `animate`.
|
|
61
64
|
* await controls.start("visible")
|
|
62
|
-
* @see https://wardic.dev/reference/solid/animation/create-animation-controls
|
|
63
65
|
*/
|
|
64
66
|
export declare const createAnimationControls: () => Config.WardicAnimationControls;
|
|
65
67
|
/** Whether `u` is **Animation controls** (Motion's `isAnimationControls`). */
|
|
66
68
|
export declare const isAnimationControls: (u: unknown) => u is Config.WardicAnimationControls;
|
|
67
|
-
/**
|
|
69
|
+
/** A Subject's `animate` as **Animation controls**, when it is them: what a binding reads once at its mount (#798); `undefined` for a target or a name. */
|
|
68
70
|
export declare const controlsOf: (animate: unknown) => Config.WardicAnimationControls | undefined;
|
|
69
|
-
/** Reach `
|
|
70
|
-
export declare const subscribe: (controls: Config.WardicAnimationControls,
|
|
71
|
+
/** Reach `controlled` from `controls`, until the returned function: its mount to its unmount. */
|
|
72
|
+
export declare const subscribe: (controls: Config.WardicAnimationControls, controlled: Controlled) => (() => void);
|
|
71
73
|
/**
|
|
72
|
-
* A
|
|
73
|
-
*
|
|
74
|
-
* lands once every element it reaches has joined, at the end of the binding's flush (`armed`), and
|
|
75
|
-
* left. One that reaches no element lands then.
|
|
74
|
+
* A Subject's entry for `definition`: a resolver called with its `custom`, values and velocities (once,
|
|
75
|
+
* as Motion's), anything else as it is.
|
|
76
76
|
*/
|
|
77
|
-
export declare const
|
|
77
|
+
export declare const entryOf: (definition: Config.WardicControlsDefinition, custom: unknown, values: Readonly<Record<string, number | string>>, velocities: Readonly<Record<string, number>>) => Config.WardicVariant | Config.WardicVariantLabels;
|
|
78
|
+
/**
|
|
79
|
+
* A change of one Subject: its entry, on `override`, and its landing, promised. It lands once every
|
|
80
|
+
* Subject it reaches has joined, at the end of the binding's flush (`armed`), and left. One that reaches
|
|
81
|
+
* no Subject lands then.
|
|
82
|
+
*/
|
|
83
|
+
export declare const changeOf: (entry: Config.WardicVariant | Config.WardicVariantLabels, override: Config.WardicTransition | undefined) => {
|
|
78
84
|
readonly change: ControlsChange;
|
|
79
85
|
readonly landing: Promise<void>;
|
|
80
86
|
};
|
|
81
|
-
/**
|
|
87
|
+
/** A Subject joins `change`: it runs a Retarget for it. */
|
|
82
88
|
export declare const join: (change: ControlsChange) => void;
|
|
83
|
-
/**
|
|
89
|
+
/** A Subject in `change` landed, or left it (a later change, its unmount): it lands once none is left and it's armed. */
|
|
84
90
|
export declare const leave: (change: ControlsChange) => void;
|
|
85
|
-
/** `change` armed, its binding's flush having run: it lands now if no
|
|
91
|
+
/** `change` armed, its binding's flush having run: it lands now if no Subject joined, or all have left. */
|
|
86
92
|
export declare const arm: (change: ControlsChange) => void;
|
|
87
93
|
/**
|
|
88
|
-
*
|
|
94
|
+
* A Subject's config with **Animation controls** for its `animate` (#433), as everything but its
|
|
89
95
|
* controls reads it: `change`'s entry (none before the first), and marked controlled, so it names its
|
|
90
96
|
* own variants whatever the entry is (Motion's `isControllingVariants`).
|
|
91
97
|
*/
|
|
92
98
|
export declare const controlledConfigOf: <C extends Pick<Config.SpineConfig, "animate">>(config: C, change: ControlsChange | undefined) => C;
|
|
93
99
|
/** A config as a server reads it (#433): one given **Animation controls** has no entry yet, and is controlled. */
|
|
94
100
|
export declare const uncontrolledOf: <C extends Pick<Config.SpineConfig, "animate">>(config: C) => C;
|
|
95
|
-
/** What a controlled
|
|
101
|
+
/** What a controlled Subject reads at a change: its `custom`, and its values and velocities now (its Snapshot). */
|
|
96
102
|
export interface ControlledState {
|
|
97
103
|
readonly custom: () => unknown;
|
|
98
104
|
/** Its Snapshot: its values, and its velocities now (#663), a spring leg's being on its Frame. */
|
|
99
105
|
readonly snapshot: ControlledSnapshot;
|
|
100
106
|
}
|
|
101
|
-
/** What Animation controls read of
|
|
107
|
+
/** What Animation controls read of a Ward's Snapshot: its values, and its velocities now (#663). */
|
|
102
108
|
export interface ControlledSnapshot {
|
|
103
109
|
readonly values: Values.Values;
|
|
104
110
|
velocitiesNow(snapshot: ControlledSnapshot): Readonly<Record<string, number>>;
|
|
105
111
|
}
|
|
106
112
|
/**
|
|
107
|
-
* A mounted
|
|
113
|
+
* A mounted Subject as its controls reach it (#433): a change sets its entry through `setChange`, its
|
|
108
114
|
* binding's signal, and arms once the binding's flush has run (a microtask after, Solid 2's included),
|
|
109
|
-
* every
|
|
115
|
+
* every Subject it reaches joined by then; `stop` ends its legs.
|
|
110
116
|
*/
|
|
111
|
-
export declare const
|
|
117
|
+
export declare const controlledSubject: (setChange: (change: ControlsChange) => void, state: ControlledState, stop: () => void) => Controlled;
|
|
112
118
|
//# sourceMappingURL=AnimationControls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimationControls.d.ts","sourceRoot":"","sources":["../../src/unstable/AnimationControls.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"AnimationControls.d.ts","sourceRoot":"","sources":["../../src/unstable/AnimationControls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,KAAK,KAAK,MAAM,MAAM,cAAc,CAAA;AAM3C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAOrC,YAAY,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAEpF;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,wGAAwG;IACxG,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,oFAAoF;IACpF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,aAAa,GAAG,MAAM,CAAC,mBAAmB,CAAA;IACtE,sGAAsG;IACtG,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,gBAAgB,GAAG,SAAS,CAAA;IACtD,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAA;IACf,gGAAgG;IAChG,KAAK,EAAE,OAAO,CAAA;IACd,+BAA+B;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAA;CAC5B;AAED,8IAA8I;AAC9I,MAAM,WAAW,UAAU;IACzB,iIAAiI;IACjI,QAAQ,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC,wBAAwB,KAAK,MAAM,CAAC,aAAa,GAAG,MAAM,CAAC,mBAAmB,CAAA;IACpH,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,aAAa,GAAG,MAAM,CAAC,mBAAmB,EAAE,QAAQ,EAAE,MAAM,CA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IAG9C,CAAA;AAED,2GAA2G;AAC3G,eAAO,MAAM,GAAG,WAAY,cAAc,KAAG,IAG5C,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,UAAU,CAAC,UAAU,cAAc,GAAG,SAAS,KAAG,CACnC,CAAA;AAE/F,kHAAkH;AAClH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,UAAU,CAAC,KAAG,CACuC,CAAA;AAEjI,mHAAmH;AACnH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAAA;IAC9B,kGAAkG;IAClG,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAA;CACtC;AAED,oGAAoG;AAEpG,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAA;IAC9B,aAAa,CAAC,QAAQ,EAAE,kBAAkB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAC9E;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,cAAe,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,SAAS,eAAe,QAAQ,MAAM,IAAI,KAAG,UASxH,CAAA"}
|
|
@@ -4,89 +4,112 @@ import { constUndefined } from "effect/Function";
|
|
|
4
4
|
import * as Predicate from "effect/Predicate";
|
|
5
5
|
import * as UndefinedOr from "effect/UndefinedOr";
|
|
6
6
|
import * as Config from "./Config.js";
|
|
7
|
-
/** The
|
|
7
|
+
/** The Subjects each controls reach, by the controls. */
|
|
8
8
|
// Module state (#460, Q7): each controls object's subscribers, held weakly by it.
|
|
9
9
|
const subscribers = new WeakMap();
|
|
10
10
|
/** `set`'s transition (#433, Motion's `setValues`): none to speak of, and no orchestration. */
|
|
11
11
|
export const INSTANT = { type: "tween", duration: 0 };
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
|
|
13
|
+
* Each Subject's entry for `definition`, worked out before any is set: a function definition that throws
|
|
14
|
+
* for one refuses the call, taking nothing, as an `animate()` call refuses one.
|
|
15
|
+
*/
|
|
16
|
+
// #979 (ADR-0074, row 35): `start` and `set` set each Subject's entry as they called its function, so one
|
|
17
|
+
// that threw for a later Subject left the earlier ones changed and the rest unreached, as #986's row 20.
|
|
18
|
+
const entriesOf = (reachedNow, definition) => Arr.map(reachedNow, (controlled) => controlled.entryOf(definition));
|
|
19
|
+
/**
|
|
20
|
+
* Makes animation controls, which animate Subjects from code by their variants or targets: a binding
|
|
21
|
+
* gives them to each Subject as its `animate`, then `start`, `set` or `stop` them. Needs no owner.
|
|
22
|
+
* Motion's `useAnimationControls`.
|
|
16
23
|
*
|
|
17
24
|
* @example
|
|
18
25
|
* const controls = createAnimationControls()
|
|
19
|
-
*
|
|
26
|
+
* // A binding gives `controls` to each Subject as its `animate`.
|
|
20
27
|
* await controls.start("visible")
|
|
21
|
-
* @see https://wardic.dev/reference/solid/animation/create-animation-controls
|
|
22
28
|
*/
|
|
23
|
-
// #433's PR 3: each `start` or `set` is a Controls change of each
|
|
29
|
+
// #433's PR 3: each `start` or `set` is a Controls change of each Subject's `animate` entry. Solid's
|
|
30
|
+
// export declares its own doc, with its markup (#1053).
|
|
24
31
|
export const createAnimationControls = () => {
|
|
25
32
|
const reached = new Set();
|
|
26
33
|
const controls = {
|
|
27
34
|
[Config.CONTROLS]: true,
|
|
28
|
-
start: (definition, transitionOverride) =>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
start: (definition, transitionOverride) => {
|
|
36
|
+
const reachedNow = Arr.fromIterable(reached);
|
|
37
|
+
const entries = entriesOf(reachedNow, definition);
|
|
38
|
+
return Promise.all(Arr.zipWith(reachedNow, entries, (controlled, entry) => controlled.change(entry, transitionOverride))).then(() => undefined);
|
|
39
|
+
},
|
|
40
|
+
set: (definition) => {
|
|
41
|
+
const reachedNow = Arr.fromIterable(reached);
|
|
42
|
+
const entries = entriesOf(reachedNow, definition);
|
|
43
|
+
Arr.forEach(Arr.zip(reachedNow, entries), ([controlled, entry]) => {
|
|
44
|
+
void controlled.change(entry, INSTANT);
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
stop: () => reached.forEach((controlled) => controlled.stop()),
|
|
33
48
|
};
|
|
34
49
|
subscribers.set(controls, reached);
|
|
35
50
|
return controls;
|
|
36
51
|
};
|
|
37
52
|
/** Whether `u` is **Animation controls** (Motion's `isAnimationControls`). */
|
|
38
53
|
export const isAnimationControls = (u) => Predicate.hasProperty(u, Config.CONTROLS);
|
|
39
|
-
/**
|
|
54
|
+
/** A Subject's `animate` as **Animation controls**, when it is them: what a binding reads once at its mount (#798); `undefined` for a target or a name. */
|
|
40
55
|
export const controlsOf = (animate) => Bool.match(isAnimationControls(animate), { onTrue: () => animate, onFalse: constUndefined });
|
|
41
|
-
/** Reach `
|
|
42
|
-
export const subscribe = (controls,
|
|
56
|
+
/** Reach `controlled` from `controls`, until the returned function: its mount to its unmount. */
|
|
57
|
+
export const subscribe = (controls, controlled) => {
|
|
43
58
|
const reached = subscribers.get(controls);
|
|
44
59
|
if (Predicate.isUndefined(reached))
|
|
45
60
|
return () => undefined;
|
|
46
|
-
reached.add(
|
|
61
|
+
reached.add(controlled);
|
|
47
62
|
return () => {
|
|
48
|
-
reached.delete(
|
|
63
|
+
reached.delete(controlled);
|
|
49
64
|
};
|
|
50
65
|
};
|
|
51
66
|
/** The changes made, counted. */
|
|
52
67
|
// Module state (#460, Q7): an id counter, only compared for order and identity.
|
|
53
68
|
let serials = 0;
|
|
54
69
|
/**
|
|
55
|
-
* A
|
|
56
|
-
*
|
|
57
|
-
|
|
58
|
-
|
|
70
|
+
* A Subject's entry for `definition`: a resolver called with its `custom`, values and velocities (once,
|
|
71
|
+
* as Motion's), anything else as it is.
|
|
72
|
+
*/
|
|
73
|
+
// #433; #979 (row 35): worked out for every Subject before any is set.
|
|
74
|
+
export const entryOf = (definition, custom, values, velocities) => Bool.match(Predicate.isFunction(definition), {
|
|
75
|
+
onTrue: () => definition(custom, { ...values }, { ...velocities }),
|
|
76
|
+
onFalse: () => definition,
|
|
77
|
+
});
|
|
78
|
+
/**
|
|
79
|
+
* A change of one Subject: its entry, on `override`, and its landing, promised. It lands once every
|
|
80
|
+
* Subject it reaches has joined, at the end of the binding's flush (`armed`), and left. One that reaches
|
|
81
|
+
* no Subject lands then.
|
|
59
82
|
*/
|
|
60
|
-
|
|
83
|
+
// #433.
|
|
84
|
+
export const changeOf = (entry, override) => {
|
|
85
|
+
// The landing's resolver, set as the promise is made: its executor runs at once, so it's set before it's read,
|
|
86
|
+
// never missing, and needs no Option. `Promise.withResolvers` would say so; it's ES2024, and core builds against
|
|
87
|
+
// ES2022 (#1053, Q18).
|
|
61
88
|
let resolve;
|
|
62
89
|
const landing = new Promise((done) => {
|
|
63
90
|
resolve = done;
|
|
64
91
|
});
|
|
65
|
-
const entry = Bool.match(Predicate.isFunction(definition), {
|
|
66
|
-
onTrue: () => definition(custom, { ...values }, { ...velocities }),
|
|
67
|
-
onFalse: () => definition,
|
|
68
|
-
});
|
|
69
92
|
const change = { serial: ++serials, definition: entry, override, pending: 0, armed: false, landed: resolve };
|
|
70
93
|
return { change, landing };
|
|
71
94
|
};
|
|
72
|
-
/**
|
|
95
|
+
/** A Subject joins `change`: it runs a Retarget for it. */
|
|
73
96
|
export const join = (change) => {
|
|
74
97
|
change.pending++;
|
|
75
98
|
};
|
|
76
|
-
/**
|
|
99
|
+
/** A Subject in `change` landed, or left it (a later change, its unmount): it lands once none is left and it's armed. */
|
|
77
100
|
export const leave = (change) => {
|
|
78
101
|
change.pending--;
|
|
79
102
|
if (change.armed && change.pending <= 0)
|
|
80
103
|
change.landed();
|
|
81
104
|
};
|
|
82
|
-
/** `change` armed, its binding's flush having run: it lands now if no
|
|
105
|
+
/** `change` armed, its binding's flush having run: it lands now if no Subject joined, or all have left. */
|
|
83
106
|
export const arm = (change) => {
|
|
84
107
|
change.armed = true;
|
|
85
108
|
if (change.pending <= 0)
|
|
86
109
|
change.landed();
|
|
87
110
|
};
|
|
88
111
|
/**
|
|
89
|
-
*
|
|
112
|
+
* A Subject's config with **Animation controls** for its `animate` (#433), as everything but its
|
|
90
113
|
* controls reads it: `change`'s entry (none before the first), and marked controlled, so it names its
|
|
91
114
|
* own variants whatever the entry is (Motion's `isControllingVariants`).
|
|
92
115
|
*/
|
|
@@ -94,13 +117,14 @@ export const controlledConfigOf = (config, change) => ({ ...config, animate: Und
|
|
|
94
117
|
/** A config as a server reads it (#433): one given **Animation controls** has no entry yet, and is controlled. */
|
|
95
118
|
export const uncontrolledOf = (config) => Bool.match(isAnimationControls(config.animate), { onTrue: () => controlledConfigOf(config, undefined), onFalse: () => config });
|
|
96
119
|
/**
|
|
97
|
-
* A mounted
|
|
120
|
+
* A mounted Subject as its controls reach it (#433): a change sets its entry through `setChange`, its
|
|
98
121
|
* binding's signal, and arms once the binding's flush has run (a microtask after, Solid 2's included),
|
|
99
|
-
* every
|
|
122
|
+
* every Subject it reaches joined by then; `stop` ends its legs.
|
|
100
123
|
*/
|
|
101
|
-
export const
|
|
102
|
-
|
|
103
|
-
|
|
124
|
+
export const controlledSubject = (setChange, state, stop) => ({
|
|
125
|
+
entryOf: (definition) => entryOf(definition, state.custom(), state.snapshot.values, state.snapshot.velocitiesNow(state.snapshot)),
|
|
126
|
+
change: (entry, override) => {
|
|
127
|
+
const made = changeOf(entry, override);
|
|
104
128
|
setChange(made.change);
|
|
105
129
|
queueMicrotask(() => arm(made.change));
|
|
106
130
|
return made.landing;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimationControls.js","sourceRoot":"","sources":["../../src/unstable/AnimationControls.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnimationControls.js","sourceRoot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AG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAA;AAgBjI;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,SAA2C,EAAE,KAAsB,EAAE,IAAgB,EAAc,EAAE,CAAC,CAAC;IACvI,OAAO,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACjI,MAAM,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAC1B,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;QACtC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACtB,cAAc,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;QACtC,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IACD,IAAI;CACL,CAAC,CAAA"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type * as Values from "../Values.ts";
|
|
2
2
|
import type * as Config from "./Config.ts";
|
|
3
3
|
import * as RetargetLegs from "./RetargetLegs.ts";
|
|
4
|
-
/**
|
|
4
|
+
/** A Subject's mount animation, described the same on the server and the client. */
|
|
5
5
|
export interface MountAnimation {
|
|
6
|
-
/** The
|
|
6
|
+
/** The Subject's tag, by which its Environment routes some keys; `undefined` for a Subject whose tag isn't known. */
|
|
7
7
|
readonly tag: string | undefined;
|
|
8
8
|
/** Each animated key's start. */
|
|
9
9
|
readonly from: Values.Values;
|
|
10
10
|
/** Each animated key's target. */
|
|
11
11
|
readonly to: Values.Values;
|
|
12
|
-
/** The
|
|
12
|
+
/** The Subject's own transition: its stagger isn't in it (ADR-0007). */
|
|
13
13
|
readonly transition: Config.WardicTransition | undefined;
|
|
14
14
|
/** Whether reduced motion is on for it (ADR-0029). */
|
|
15
15
|
readonly reduced: boolean;
|
|
@@ -22,11 +22,17 @@ export interface MountAnimation {
|
|
|
22
22
|
readonly stops?: RetargetLegs.StopsByKey | undefined;
|
|
23
23
|
/**
|
|
24
24
|
* Whether it's a **Skipped animation** (#468): every key lands on its first frame, so its Appear
|
|
25
|
-
* animation takes 0 s, holding its end from first
|
|
25
|
+
* animation takes 0 s, holding its end from the first frame drawn. Part of its key; left out when it isn't.
|
|
26
26
|
*/
|
|
27
27
|
readonly skipped?: boolean | undefined;
|
|
28
28
|
/** Its **Transform template** (#443): its stops drawn through it, as the client draws them. Left out with none. */
|
|
29
29
|
readonly template?: Config.SpineConfig["transformTemplate"];
|
|
30
|
+
/**
|
|
31
|
+
* Each key already at its target, which it leaves where it is, at its value, as the client writes it
|
|
32
|
+
* beside the moving keys: its Environment may draw some of them together with those in each stop.
|
|
33
|
+
* Part of its key when it draws any; none, or an empty one, holds nothing.
|
|
34
|
+
*/
|
|
35
|
+
readonly held?: Values.Values | undefined;
|
|
30
36
|
}
|
|
31
37
|
/** Whether a transition repeats for ever: a tween's `repeat: Infinity`, a tween as it runs (ADR-0051). */
|
|
32
38
|
export declare const repeatsForever: (transition: Config.WardicTransition | undefined) => boolean;
|
|
@@ -36,7 +42,7 @@ export declare const ownDelayOf: (transition: Config.WardicTransition | undefine
|
|
|
36
42
|
export declare const skippedField: (skipped: boolean) => {
|
|
37
43
|
readonly skipped?: true;
|
|
38
44
|
};
|
|
39
|
-
/**
|
|
45
|
+
/** A Subject's Appear animation, found at mount: the spine starts its first legs as far in as it has got. */
|
|
40
46
|
export interface Handoff {
|
|
41
47
|
/** How far its animation has run, in seconds (its delay included). */
|
|
42
48
|
readonly elapsed: () => number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppearHandoff.d.ts","sourceRoot":"","sources":["../../src/unstable/AppearHandoff.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,K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C,gBAAgB,GAAG,SAAS,KAAG,OACyH,CAAA;AAE1M,+CAA+C;AAC/C,eAAO,MAAM,UAAU,eAAgB,MAAM,CAAC,gBAAgB,GAAG,SAAS,KAAG,MACiB,CAAA;AAU9F,6FAA6F;AAC7F,eAAO,MAAM,YAAY,YAAa,OAAO,KAAG;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAA;CAA8F,CAAA;AAEvK,6GAA6G;AAC7G,MAAM,WAAW,OAAO;IACtB,sEAAsE;IACtE,QAAQ,CAAC,OAAO,EAAE,MAAM,MAAM,CAAA;IAC9B,qDAAqD;IACrD,QAAQ,CAAC,KAAK,EAAE,MAAM,MAAM,CAAA;CAC7B;AAED;;;;;GAKG;AACH,eAAO,MAAM,SAAS,YAAa,OAAO,iBAAiB,MAAM,CAAC,gBAAgB,GAAG,SAAS,eAAe,MAAM,WAAS,MAC3C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppearHandoff.js","sourceRoot":"","sources":["../../src/unstable/AppearHandoff.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAA;AACtC,OAAO,KAAK,WAAW,MAAM,oBAAoB,CAAA;AAEjD,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"AppearHandoff.js","sourceRoot":"","sources":["../../src/unstable/AppearHandoff.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAA;AACtC,OAAO,KAAK,WAAW,MAAM,oBAAoB,CAAA;AAEjD,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAqCjD,0GAA0G;AAC1G,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAA+C,EAAW,EAAE,CACzF,WAAW,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE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
|
readonly delay: number;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
* Each key's plan for a change, by its index, as a
|
|
49
|
+
* Each key's plan for a change, by its index, as a Ward's Subject's keys run (#301): its entry, else
|
|
50
50
|
* `default`, else the transition's own fields; reduced motion's Snap for a positional key that doesn't
|
|
51
51
|
* opt out; its Default transition, held by its own `delay`, for a key whose transition isn't defined.
|
|
52
52
|
*/
|
|
@@ -141,7 +141,7 @@ export declare const isMember: Predicate.Refinement<unknown, Imperative.BatchMem
|
|
|
141
141
|
/**
|
|
142
142
|
* A compiled sequence's parts (Q40): each Batch's members as one part, in the order they first appear,
|
|
143
143
|
* with their animations; every other subject as it is. `restOf` gives what of a member's animation its
|
|
144
|
-
* Subject takes itself (
|
|
144
|
+
* Subject takes itself (`@wardic/dom`'s member's own keys the Batch doesn't draw), when it takes any.
|
|
145
145
|
*/
|
|
146
146
|
export declare const sequencePartsOf: <X, S>(compiled: ReadonlyArray<readonly [X | Imperative.BatchMember, Sequence.Animation]>, restOf?: (member: Imperative.BatchMember, animation: Sequence.Animation) => readonly [S, Sequence.Animation] | undefined) => {
|
|
147
147
|
readonly batches: ReadonlyArray<Imperative.SequencePart>;
|
|
@@ -63,7 +63,7 @@ const snapAfter = (delay) => {
|
|
|
63
63
|
return made;
|
|
64
64
|
};
|
|
65
65
|
/**
|
|
66
|
-
* A Default transition held by a key's own `delay`, as a
|
|
66
|
+
* A Default transition held by a key's own `delay`, as a Ward's Subject's is when its transition gives
|
|
67
67
|
* only a delay (ADR-0051): one object for each transition and delay, so the members on it share it.
|
|
68
68
|
*/
|
|
69
69
|
// Module state (#460, Q7): a cache held weakly by the object it's for, so it goes with it.
|
|
@@ -85,8 +85,8 @@ export const delayedBy = (transition, delay) => {
|
|
|
85
85
|
};
|
|
86
86
|
/**
|
|
87
87
|
* A transition without a `stagger()` delay, which a change gives each member by its place: one object
|
|
88
|
-
* each. A `delay` in seconds stays, held by the keys the transition's own fields reach, as a
|
|
89
|
-
*
|
|
88
|
+
* each. A `delay` in seconds stays, held by the keys the transition's own fields reach, as a Ward's
|
|
89
|
+
* Subject's top-level delay is.
|
|
90
90
|
*/
|
|
91
91
|
// Module state (#460, Q7): a cache held weakly by the object it's for, so it goes with it.
|
|
92
92
|
const UNSTAGGERED = new WeakMap();
|
|
@@ -118,7 +118,7 @@ const batchRunOf = (run, key, fail) => {
|
|
|
118
118
|
return run;
|
|
119
119
|
};
|
|
120
120
|
/**
|
|
121
|
-
* Each key's plan for a change, by its index, as a
|
|
121
|
+
* Each key's plan for a change, by its index, as a Ward's Subject's keys run (#301): its entry, else
|
|
122
122
|
* `default`, else the transition's own fields; reduced motion's Snap for a positional key that doesn't
|
|
123
123
|
* opt out; its Default transition, held by its own `delay`, for a key whose transition isn't defined.
|
|
124
124
|
*/
|
|
@@ -291,7 +291,7 @@ export const isMember = /*#__PURE__*/ Predicate.and(
|
|
|
291
291
|
/**
|
|
292
292
|
* A compiled sequence's parts (Q40): each Batch's members as one part, in the order they first appear,
|
|
293
293
|
* with their animations; every other subject as it is. `restOf` gives what of a member's animation its
|
|
294
|
-
* Subject takes itself (
|
|
294
|
+
* Subject takes itself (`@wardic/dom`'s member's own keys the Batch doesn't draw), when it takes any.
|
|
295
295
|
*/
|
|
296
296
|
export const sequencePartsOf = (compiled, restOf) => {
|
|
297
297
|
const byBinding = new Map();
|