@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,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The rules of
|
|
3
|
-
* names
|
|
2
|
+
* The rules of a Subject's place in variant orchestration (ADR-0007, #50), on every binding: the
|
|
3
|
+
* names a Subject hands its children and inherits from its parent, the values it starts from, and
|
|
4
4
|
* what a server render builds. Each binding's variant node runs the orchestration over them, with its
|
|
5
5
|
* own reactivity.
|
|
6
6
|
*
|
|
7
7
|
* Motion's rule (CONTEXT.md, **Variant child**):
|
|
8
|
-
* -
|
|
8
|
+
* - A Subject that names its own variants, a name on any variant prop (`initial`, `animate`, the
|
|
9
9
|
* `while*` gestures, `exit`; #618), hands its children its `initial` and `animate` names, and an
|
|
10
10
|
* `initial={false}` with them (#134). Any other passes its parent's through, unless it sets
|
|
11
11
|
* `inherit={false}`, which passes none.
|
|
12
12
|
* - A **Variant child** (`variants`, no names of its own, `inherit` not `false`) inherits its
|
|
13
13
|
* ancestor's names and default transition, takes a stagger slot among the ancestor's variant
|
|
14
14
|
* children, and counts for the ancestor's `when`.
|
|
15
|
-
* -
|
|
16
|
-
* join: it owns their registry, their stagger and their `when`. Any other
|
|
15
|
+
* - A Subject with variants of its own (`variants`, or a name) is what its Variant children
|
|
16
|
+
* join: it owns their registry, their stagger and their `when`. Any other Subject passes its
|
|
17
17
|
* parent's context through, so a Variant child joins its nearest such ancestor; it renders no
|
|
18
18
|
* Provider unless it sets `inherit={false}` ({@link changesContext}).
|
|
19
19
|
*
|
|
@@ -23,9 +23,12 @@
|
|
|
23
23
|
*/
|
|
24
24
|
import * as Stagger from "../Stagger.ts";
|
|
25
25
|
import type * as Values from "../Values.ts";
|
|
26
|
+
import type * as WardicServices from "./WardicServices.ts";
|
|
27
|
+
import type * as Option from "effect/Option";
|
|
26
28
|
import * as AnimationControls from "./AnimationControls.ts";
|
|
27
29
|
import type * as Config from "./Config.ts";
|
|
28
30
|
import type * as Reactivity from "./Reactivity.ts";
|
|
31
|
+
import * as VariantTarget from "./VariantTarget.ts";
|
|
29
32
|
/**
|
|
30
33
|
* The handle a child receives from {@link WardicVariantContextValue.register}
|
|
31
34
|
* when it mounts under a `ward.Provider` (ADR-0007, step 21b).
|
|
@@ -80,7 +83,7 @@ export interface WardicStaggerConfig {
|
|
|
80
83
|
* inherit).
|
|
81
84
|
* - `initial` — the parent's `initial` NAME, or `false`, read once (#50, #134).
|
|
82
85
|
*
|
|
83
|
-
* Every
|
|
86
|
+
* Every Ward's Subject provides one (#50): its own if it has variants of its own, else its
|
|
84
87
|
* parent's, passed through (`variant-node.ts`).
|
|
85
88
|
* - `transition` — the parent's transition, inherited as the DEFAULT for
|
|
86
89
|
* children that supply no local `transition`.
|
|
@@ -92,9 +95,9 @@ export interface WardicStaggerConfig {
|
|
|
92
95
|
export type GestureLayer = "inView" | "focused" | "hovered" | "pressed" | "dragged";
|
|
93
96
|
/** The gesture layers in Motion's priority, lowest first. */
|
|
94
97
|
export declare const GESTURE_LAYERS: ReadonlyArray<GestureLayer>;
|
|
95
|
-
/** The variant names
|
|
98
|
+
/** The variant names a Subject hands its Variant children for its active gestures (#291): a name or a list each (#297). */
|
|
96
99
|
export type GestureNames = Readonly<Partial<Record<GestureLayer, Config.WardicVariantLabels | undefined>>>;
|
|
97
|
-
/** No gesture on: what
|
|
100
|
+
/** No gesture on: what a Subject with none active hands down. */
|
|
98
101
|
export declare const NO_GESTURE_NAMES: GestureNames;
|
|
99
102
|
/** Two {@link GestureNames} the same: the same names for each gesture, a list name by name (#297). */
|
|
100
103
|
export declare const sameGestureNames: (a: GestureNames, b: GestureNames) => boolean;
|
|
@@ -103,7 +106,7 @@ export type GestureStates = Readonly<Record<GestureLayer, boolean>>;
|
|
|
103
106
|
/** No gesture on. */
|
|
104
107
|
export declare const NO_GESTURE_STATES: GestureStates;
|
|
105
108
|
/**
|
|
106
|
-
* What
|
|
109
|
+
* What a Subject hands its Variant children for its gestures (#291, Motion's `setActive` and variant
|
|
107
110
|
* context): whether each is on (its own, or its own provider's), and each one's label (its own
|
|
108
111
|
* `while*`, if a name, else the one it took). A Variant child's gesture is on while its provider's is.
|
|
109
112
|
*/
|
|
@@ -111,7 +114,7 @@ export interface GestureHandDown {
|
|
|
111
114
|
readonly on: GestureStates;
|
|
112
115
|
readonly names: GestureNames;
|
|
113
116
|
}
|
|
114
|
-
/** Nothing on, no labels: what
|
|
117
|
+
/** Nothing on, no labels: what a Subject hands down with no provider and no gesture. */
|
|
115
118
|
export declare const NO_HAND_DOWN: GestureHandDown;
|
|
116
119
|
/** Two hand-downs the same: each gesture on alike, with the same label. */
|
|
117
120
|
export declare const sameHandDown: (a: GestureHandDown, b: GestureHandDown) => boolean;
|
|
@@ -127,7 +130,7 @@ export interface GestureConfig {
|
|
|
127
130
|
}
|
|
128
131
|
/** Each gesture on: its own, or its provider's. */
|
|
129
132
|
export declare const gesturesOn: (own: GestureStates, above: GestureStates) => GestureStates;
|
|
130
|
-
/** What
|
|
133
|
+
/** What a Subject hands down (#291), from its config, its own states, and what it takes. */
|
|
131
134
|
export declare const handDownOf: (config: GestureConfig, own: GestureStates, above: GestureHandDown) => GestureHandDown;
|
|
132
135
|
/** The name each gesture's layer resolves while it's on (#291): its label then; off, none. */
|
|
133
136
|
export declare const activeNamesOf: (handDown: GestureHandDown) => GestureNames;
|
|
@@ -201,7 +204,7 @@ export interface WardicVariantContextValue {
|
|
|
201
204
|
readonly staggerFor?: (name: string | undefined) => WardicStaggerConfig;
|
|
202
205
|
/**
|
|
203
206
|
* For a list: whether a Variant child's keys of `name` may start, that name's own
|
|
204
|
-
* `beforeChildren`: true unless it has one and this
|
|
207
|
+
* `beforeChildren`: true unless it has one and this Subject's keys of that name haven't settled
|
|
205
208
|
* since its list last changed. Optional: left out, always.
|
|
206
209
|
*/
|
|
207
210
|
readonly mayStartFor?: (name: string) => boolean;
|
|
@@ -227,7 +230,7 @@ export interface WardicVariantContextValue {
|
|
|
227
230
|
*/
|
|
228
231
|
readonly appearGroup?: unknown;
|
|
229
232
|
}
|
|
230
|
-
/** The part of
|
|
233
|
+
/** The part of a Subject's config its place in variant orchestration reads. */
|
|
231
234
|
export interface VariantConfig extends GestureConfig {
|
|
232
235
|
readonly initial?: object | Config.WardicVariantLabels | false | undefined;
|
|
233
236
|
readonly animate?: object | Config.WardicVariantLabels | undefined;
|
|
@@ -243,7 +246,7 @@ export interface VariantConfig extends GestureConfig {
|
|
|
243
246
|
*/
|
|
244
247
|
readonly controlled?: boolean | undefined;
|
|
245
248
|
}
|
|
246
|
-
/** An `initial`
|
|
249
|
+
/** An `initial` a Subject hands its children: a variant name or list (#297), `false` (#134), or `undefined` for a values map or nothing. */
|
|
247
250
|
export declare const initialNameOf: (entry: object | Config.WardicVariantLabels | false | undefined) => Config.WardicVariantLabels | false | undefined;
|
|
248
251
|
/** A variant name or a list of names (#297), or `undefined` for a values map or nothing. */
|
|
249
252
|
export declare const nameOf: (entry: object | Config.WardicVariantLabels | undefined) => Config.WardicVariantLabels | undefined;
|
|
@@ -253,56 +256,71 @@ export declare const nameOf: (entry: object | Config.WardicVariantLabels | undef
|
|
|
253
256
|
* or as its binding marks the config it reads (Motion's `isControllingVariants`, `isVariantLabel`).
|
|
254
257
|
*/
|
|
255
258
|
export declare const namesOwnVariants: (config: VariantConfig) => boolean;
|
|
256
|
-
/** Whether
|
|
259
|
+
/** Whether a Subject has variants of its own, so Variant children join it (Motion's `isVariantNode`). */
|
|
257
260
|
export declare const hasOwnVariants: (config: VariantConfig) => boolean;
|
|
258
261
|
/**
|
|
259
|
-
* Whether
|
|
260
|
-
* Provider (#50): it has variants of its own, or it sets `inherit={false}`. Any other
|
|
262
|
+
* Whether a Subject changes what its children read, so it renders its variant context's
|
|
263
|
+
* Provider (#50): it has variants of its own, or it sets `inherit={false}`. Any other Subject hands
|
|
261
264
|
* its children its parent's context as it is, so it renders none. Decided once, at setup, from the
|
|
262
265
|
* same props on a server and on the client, so the nesting never changes after mount.
|
|
263
266
|
*/
|
|
264
267
|
export declare const changesContext: (config: VariantConfig) => boolean;
|
|
265
268
|
/**
|
|
266
|
-
* The **Controls change** in effect for
|
|
267
|
-
* it inherits from is in, else none. Per mount, for every
|
|
269
|
+
* The **Controls change** in effect for a Subject (#433): its own controls', else the one the context
|
|
270
|
+
* it inherits from is in, else none. Per mount, for every Subject (#460): guards, nothing built.
|
|
268
271
|
*/
|
|
269
272
|
export declare const controlsChangeOf: (controls: Reactivity.Accessor<AnimationControls.ControlsChange | undefined> | undefined, inherited: WardicVariantContextValue | undefined) => Reactivity.Accessor<AnimationControls.ControlsChange | undefined>;
|
|
270
|
-
/** Whether
|
|
273
|
+
/** Whether a Subject is a **Variant child** (CONTEXT.md). */
|
|
271
274
|
export declare const isVariantChild: (config: VariantConfig) => boolean;
|
|
272
|
-
/** The context
|
|
275
|
+
/** The context a Subject inherits names and its default transition from: its parent's, for a Variant child. */
|
|
273
276
|
export declare const inheritedContext: (config: VariantConfig, parent: WardicVariantContextValue | undefined) => WardicVariantContextValue | undefined;
|
|
274
277
|
/**
|
|
275
|
-
* The `initial`
|
|
278
|
+
* The `initial` a Subject's Starting style resolves: its own, else the `initial` name (or `false`) of
|
|
276
279
|
* the context it inherits from (#50, #134). Read once, as every `initial` is.
|
|
277
280
|
*/
|
|
278
281
|
export declare const initialOf: (config: VariantConfig, inherited: WardicVariantContextValue | undefined) => object | Config.WardicVariantLabels | false | undefined;
|
|
279
282
|
/**
|
|
280
|
-
* Whether
|
|
283
|
+
* Whether a Subject starts at its `animate`, with nothing animating at mount (#134, Motion's
|
|
281
284
|
* `isInitialAnimationBlocked`): its `initial` (own or inherited) is `false`, or it renders with an
|
|
282
285
|
* `<AnimatePresence initial={false}>`'s first render (`presenceBlocks`).
|
|
283
286
|
*/
|
|
284
287
|
export declare const startsAtAnimate: (config: VariantConfig, inherited: WardicVariantContextValue | undefined, presenceBlocks: boolean) => boolean;
|
|
285
288
|
/**
|
|
286
|
-
* Whether
|
|
289
|
+
* Whether a Subject's mount tells nothing (#448, Motion's `animation-state.ts`): it
|
|
287
290
|
* {@link startsAtAnimate}, or its `initial` (own, else inherited) is the same name, list or values map
|
|
288
291
|
* as its `animate` (own, else inherited). Its first Retarget, landing with nothing to animate, is told
|
|
289
292
|
* to no one. Read once, untracked.
|
|
290
293
|
*/
|
|
291
294
|
export declare const startsQuiet: (config: VariantConfig, inherited: WardicVariantContextValue | undefined, presenceBlocks: boolean, untrack: Reactivity.Reactivity["untrack"]) => boolean;
|
|
295
|
+
/** What a Subject starts from, and the first of its variants whose resolver threw (#979). */
|
|
296
|
+
export interface Starting {
|
|
297
|
+
readonly values: Values.Values;
|
|
298
|
+
readonly failure: Option.Option<VariantTarget.VariantFailure>;
|
|
299
|
+
}
|
|
292
300
|
/**
|
|
293
|
-
* The values
|
|
301
|
+
* The values a Subject starts from, its Starting style's input (ADR-0003): its `initial` (own, else
|
|
294
302
|
* inherited, #50), or, when it {@link startsAtAnimate}, its `animate` (own, else inherited), as
|
|
295
303
|
* Motion's `initial={false}` (#134). Read once: an inherited name is read through `untrack`.
|
|
296
304
|
*/
|
|
297
305
|
export declare const startingValuesOf: (config: VariantConfig, inherited: WardicVariantContextValue | undefined, presenceBlocks: boolean, untrack: Reactivity.Reactivity["untrack"]) => Values.Values;
|
|
298
306
|
/**
|
|
299
|
-
*
|
|
307
|
+
* {@link startingValuesOf}, with what a resolver among the Subject's variants threw: its entry gives no
|
|
308
|
+
* values, and the Subject starts at the rest (#979).
|
|
309
|
+
*/
|
|
310
|
+
export declare const startingOf: (config: VariantConfig, inherited: WardicVariantContextValue | undefined, presenceBlocks: boolean, untrack: Reactivity.Reactivity["untrack"]) => Starting;
|
|
311
|
+
/**
|
|
312
|
+
* {@link startingValuesOf} from its variants already resolved to values (`VariantTarget.startingVariantsOf`):
|
|
313
|
+
* what a Subject's start reads, which reads their failure too.
|
|
314
|
+
*/
|
|
315
|
+
export declare const startingValuesFrom: (config: VariantConfig, inherited: WardicVariantContextValue | undefined, presenceBlocks: boolean, untrack: Reactivity.Reactivity["untrack"], variants: object | undefined) => Values.Values;
|
|
316
|
+
/**
|
|
317
|
+
* A name a Subject hands its children (Motion's `getCurrentTreeVariants`): `own` if it names its own
|
|
300
318
|
* variants, else `fromParent` unless it sets `inherit={false}`.
|
|
301
319
|
*/
|
|
302
320
|
export declare const handedDown: <A extends Config.WardicVariantLabels | false>(config: VariantConfig, own: () => A | undefined, fromParent: () => A | undefined) => A | undefined;
|
|
303
|
-
/**
|
|
321
|
+
/** A Subject's own transition, else the one it inherits. */
|
|
304
322
|
export declare const ownOrInherited: (own: Config.WardicTransition | undefined, inherited: WardicVariantContextValue | undefined) => Config.WardicTransition | undefined;
|
|
305
|
-
/** The stagger config
|
|
323
|
+
/** The stagger config a Subject's `transition` gives its Variant children. */
|
|
306
324
|
export declare const staggerOf: (transition: Config.WardicTransition | undefined) => WardicStaggerConfig;
|
|
307
325
|
/** A context's stagger config for one of its names (#297): its `staggerFor`'s, else its whole orchestration's. */
|
|
308
326
|
export declare const staggerOfName: (context: WardicVariantContextValue, name: string | undefined) => WardicStaggerConfig;
|
|
@@ -310,14 +328,30 @@ export declare const staggerOfName: (context: WardicVariantContextValue, name: s
|
|
|
310
328
|
export declare const mayStartOf: (context: WardicVariantContextValue, name: string) => boolean;
|
|
311
329
|
/** A child's place in a stagger, turned by its `staggerDirection`: `-1` counts from the last. */
|
|
312
330
|
export declare const directed: (index: number, total: number, direction: 1 | -1) => number;
|
|
331
|
+
/**
|
|
332
|
+
* Where a stagger reports a `delayChildren` function that throws: the runtime it's reported on, and whether
|
|
333
|
+
* it's failing, so a run of throws is reported once. A Variant child's is its Subject's, for its life, its
|
|
334
|
+
* run ended by its next clean call. A presence's exit and a server's Appear timing make one for the event,
|
|
335
|
+
* `event`, whose first throw is reported whatever its other calls do.
|
|
336
|
+
*/
|
|
337
|
+
export interface DelayFailures {
|
|
338
|
+
delayFailing: boolean;
|
|
339
|
+
readonly runtime: Pick<WardicServices.Runner<never>, "runFork">;
|
|
340
|
+
readonly event?: true;
|
|
341
|
+
}
|
|
342
|
+
/** The runtime a server render reports on: Effect's default, as a server holds no app reporters. */
|
|
343
|
+
export declare const ON_SERVER: Pick<WardicServices.Runner<never>, "runFork">;
|
|
344
|
+
/** One exit's or one render's {@link DelayFailures}, reported on `runtime` at its first throw. */
|
|
345
|
+
export declare const eventDelayFailuresOf: (runtime: Pick<WardicServices.Runner<never>, "runFork">) => DelayFailures;
|
|
313
346
|
/**
|
|
314
347
|
* A child's delay in a stagger (ADR-0007): its `delayChildren` plus its place from the origin, turned
|
|
315
348
|
* by its `staggerDirection`. A function `delayChildren` (#436, Motion's `calcChildStagger`) decides it
|
|
316
|
-
* whole, from the child's index and the count
|
|
317
|
-
*
|
|
349
|
+
* whole, from the child's index and the count; one that throws gives the child no delay, reported on
|
|
350
|
+
* `failures` (on Effect's default runtime with none) at the first throw of a run of them. Every stagger,
|
|
351
|
+
* a Variant child's, a presence's exit's and a server's Appear timing, is placed by it.
|
|
318
352
|
*/
|
|
319
|
-
export declare const childDelayOf: (s: WardicStaggerConfig, index: number, total: number) => number;
|
|
320
|
-
/** A name's orchestration (#297): its stagger config, and its own `when`, from its own transition, else the
|
|
353
|
+
export declare const childDelayOf: (s: WardicStaggerConfig, index: number, total: number, failures: DelayFailures | undefined) => number;
|
|
354
|
+
/** A name's orchestration (#297): its stagger config, and its own `when`, from its own transition, else the Subject's. */
|
|
321
355
|
export interface NameConfig {
|
|
322
356
|
readonly stagger: WardicStaggerConfig;
|
|
323
357
|
readonly when: "beforeChildren" | "afterChildren" | undefined;
|
|
@@ -332,11 +366,11 @@ export declare const staggerWith: ({ staggerChildren, delayChildren, from, stagg
|
|
|
332
366
|
* pressed, made a new, equal config at each press and release, `UNSTABLE_MEMO_OUTPUT`).
|
|
333
367
|
*/
|
|
334
368
|
export declare const sameStagger: (a: WardicStaggerConfig, b: WardicStaggerConfig) => boolean;
|
|
335
|
-
/** What
|
|
369
|
+
/** What a Subject provides when it has no variants of its own: its parent's context, unless `inherit={false}`. */
|
|
336
370
|
export declare const passedThrough: (config: VariantConfig, parent: WardicVariantContextValue | undefined) => WardicVariantContextValue | undefined;
|
|
337
371
|
/** A registration that does nothing: a server render has no orchestration to join. */
|
|
338
372
|
export declare const INERT_REGISTRATION: WardicChildRegistration;
|
|
339
|
-
/**
|
|
373
|
+
/** A Subject's place in variant orchestration during a server render (ADR-0021). */
|
|
340
374
|
export interface ServerVariantNode {
|
|
341
375
|
/** What its children read: the same context the client builds, with inert orchestration. */
|
|
342
376
|
readonly provided: WardicVariantContextValue | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VariantTree.d.ts","sourceRoot":"","sources":["../../src/unstable/VariantTree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,KAAK,MAAM,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"VariantTree.d.ts","sourceRoot":"","sources":["../../src/unstable/VariantTree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,OAAO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H,kHAAkH;AAClH,eAAO,MAAM,aAAa,WAChB,aAAa,UACb,yBAAyB,GAAG,SAAS,KAC5C,yBAAyB,GAAG,SAAoG,CAAA;AAEnI,sFAAsF;AACtF,eAAO,MAAM,kBAAkB,EAAE,uBAK/B,CAAA;AAEF,oFAAoF;AACpF,MAAM,WAAW,iBAAiB;IAChC,4FAA4F;IAC5F,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,GAAG,SAAS,CAAA;IACxD,uEAAuE;IACvE,QAAQ,CAAC,SAAS,EAAE,yBAAyB,GAAG,SAAS,CAAA;CAC1D;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,WAAY,aAAa,UAAU,yBAAyB,GAAG,SAAS,KAAG,iBAqBxG,CAAA"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The rules of
|
|
3
|
-
* names
|
|
2
|
+
* The rules of a Subject's place in variant orchestration (ADR-0007, #50), on every binding: the
|
|
3
|
+
* names a Subject hands its children and inherits from its parent, the values it starts from, and
|
|
4
4
|
* what a server render builds. Each binding's variant node runs the orchestration over them, with its
|
|
5
5
|
* own reactivity.
|
|
6
6
|
*
|
|
7
7
|
* Motion's rule (CONTEXT.md, **Variant child**):
|
|
8
|
-
* -
|
|
8
|
+
* - A Subject that names its own variants, a name on any variant prop (`initial`, `animate`, the
|
|
9
9
|
* `while*` gestures, `exit`; #618), hands its children its `initial` and `animate` names, and an
|
|
10
10
|
* `initial={false}` with them (#134). Any other passes its parent's through, unless it sets
|
|
11
11
|
* `inherit={false}`, which passes none.
|
|
12
12
|
* - A **Variant child** (`variants`, no names of its own, `inherit` not `false`) inherits its
|
|
13
13
|
* ancestor's names and default transition, takes a stagger slot among the ancestor's variant
|
|
14
14
|
* children, and counts for the ancestor's `when`.
|
|
15
|
-
* -
|
|
16
|
-
* join: it owns their registry, their stagger and their `when`. Any other
|
|
15
|
+
* - A Subject with variants of its own (`variants`, or a name) is what its Variant children
|
|
16
|
+
* join: it owns their registry, their stagger and their `when`. Any other Subject passes its
|
|
17
17
|
* parent's context through, so a Variant child joins its nearest such ancestor; it renders no
|
|
18
18
|
* Provider unless it sets `inherit={false}` ({@link changesContext}).
|
|
19
19
|
*
|
|
@@ -22,11 +22,14 @@
|
|
|
22
22
|
* @module
|
|
23
23
|
*/
|
|
24
24
|
// Unstable: ADR-0071, decision 5. #672: solid's `variant-tree.ts`, moved for the spine to read an
|
|
25
|
-
//
|
|
25
|
+
// Subject's place in variant orchestration in core.
|
|
26
26
|
import * as Stagger from "../Stagger.js";
|
|
27
|
+
import * as Report from "./Report.js";
|
|
27
28
|
import * as Stops from "./Stops.js";
|
|
28
29
|
import * as Arr from "effect/Array";
|
|
29
30
|
import * as Bool from "effect/Boolean";
|
|
31
|
+
import * as Cause from "effect/Cause";
|
|
32
|
+
import * as Effect from "effect/Effect";
|
|
30
33
|
import { constTrue, constUndefined, identity } from "effect/Function";
|
|
31
34
|
import * as Predicate from "effect/Predicate";
|
|
32
35
|
import * as UndefinedOr from "effect/UndefinedOr";
|
|
@@ -34,19 +37,19 @@ import * as AnimationControls from "./AnimationControls.js";
|
|
|
34
37
|
import * as VariantTarget from "./VariantTarget.js";
|
|
35
38
|
/** The gesture layers in Motion's priority, lowest first. */
|
|
36
39
|
export const GESTURE_LAYERS = ["inView", "focused", "hovered", "pressed", "dragged"];
|
|
37
|
-
/** No gesture on: what
|
|
40
|
+
/** No gesture on: what a Subject with none active hands down. */
|
|
38
41
|
export const NO_GESTURE_NAMES = {};
|
|
39
42
|
/** Two {@link GestureNames} the same: the same names for each gesture, a list name by name (#297). */
|
|
40
43
|
export const sameGestureNames = (a, b) => GESTURE_LAYERS.every((layer) => VariantTarget.sameLabels(a[layer], b[layer]));
|
|
41
44
|
/** No gesture on. */
|
|
42
45
|
export const NO_GESTURE_STATES = { inView: false, focused: false, hovered: false, pressed: false, dragged: false };
|
|
43
|
-
/** Nothing on, no labels: what
|
|
46
|
+
/** Nothing on, no labels: what a Subject hands down with no provider and no gesture. */
|
|
44
47
|
export const NO_HAND_DOWN = { on: NO_GESTURE_STATES, names: NO_GESTURE_NAMES };
|
|
45
48
|
/** Two hand-downs the same: each gesture on alike, with the same label. */
|
|
46
49
|
export const sameHandDown = (a, b) => GESTURE_LAYERS.every((layer) => Bool.and(a.on[layer] === b.on[layer], VariantTarget.sameLabels(a.names[layer], b.names[layer])));
|
|
47
50
|
/** What a context hands down, nothing without a context or its gestures. */
|
|
48
51
|
export const handDownFrom = (context) => {
|
|
49
|
-
// Per Retarget, per
|
|
52
|
+
// Per Retarget, per Subject: guards, nothing made (most Subjects have no provider).
|
|
50
53
|
if (Predicate.isUndefined(context))
|
|
51
54
|
return NO_HAND_DOWN;
|
|
52
55
|
const gestures = context.gestures;
|
|
@@ -68,7 +71,7 @@ const labelOf = (own, inherited) => {
|
|
|
68
71
|
return nameOf(own);
|
|
69
72
|
return inherited;
|
|
70
73
|
};
|
|
71
|
-
/** What
|
|
74
|
+
/** What a Subject hands down (#291), from its config, its own states, and what it takes. */
|
|
72
75
|
export const handDownOf = (config, own, above) => ({
|
|
73
76
|
on: gesturesOn(own, above.on),
|
|
74
77
|
names: {
|
|
@@ -144,7 +147,7 @@ export const topGestureName = (names) => UndefinedOr.match(names.dragged, {
|
|
|
144
147
|
}),
|
|
145
148
|
}),
|
|
146
149
|
});
|
|
147
|
-
/** An `initial`
|
|
150
|
+
/** An `initial` a Subject hands its children: a variant name or list (#297), `false` (#134), or `undefined` for a values map or nothing. */
|
|
148
151
|
export const initialNameOf = (entry) => Bool.match(entry === false, { onTrue: () => false, onFalse: () => nameOf(entry) });
|
|
149
152
|
/** A variant name or a list of names (#297), or `undefined` for a values map or nothing. */
|
|
150
153
|
export const nameOf = (entry) => Bool.match(VariantTarget.isLabels(entry), { onTrue: () => entry, onFalse: constUndefined });
|
|
@@ -165,18 +168,18 @@ export const namesOwnVariants = (config) => config.controlled === true ||
|
|
|
165
168
|
VariantTarget.isLabels(config.whileTap) ||
|
|
166
169
|
VariantTarget.isLabels(config.whileDrag) ||
|
|
167
170
|
VariantTarget.isLabels(config.exit);
|
|
168
|
-
/** Whether
|
|
171
|
+
/** Whether a Subject has variants of its own, so Variant children join it (Motion's `isVariantNode`). */
|
|
169
172
|
export const hasOwnVariants = (config) => Predicate.isNotUndefined(config.variants) || namesOwnVariants(config);
|
|
170
173
|
/**
|
|
171
|
-
* Whether
|
|
172
|
-
* Provider (#50): it has variants of its own, or it sets `inherit={false}`. Any other
|
|
174
|
+
* Whether a Subject changes what its children read, so it renders its variant context's
|
|
175
|
+
* Provider (#50): it has variants of its own, or it sets `inherit={false}`. Any other Subject hands
|
|
173
176
|
* its children its parent's context as it is, so it renders none. Decided once, at setup, from the
|
|
174
177
|
* same props on a server and on the client, so the nesting never changes after mount.
|
|
175
178
|
*/
|
|
176
179
|
export const changesContext = (config) => hasOwnVariants(config) || config.inherit === false;
|
|
177
180
|
/**
|
|
178
|
-
* The **Controls change** in effect for
|
|
179
|
-
* it inherits from is in, else none. Per mount, for every
|
|
181
|
+
* The **Controls change** in effect for a Subject (#433): its own controls', else the one the context
|
|
182
|
+
* it inherits from is in, else none. Per mount, for every Subject (#460): guards, nothing built.
|
|
180
183
|
*/
|
|
181
184
|
export const controlsChangeOf = (controls, inherited) => {
|
|
182
185
|
if (Predicate.isNotUndefined(controls))
|
|
@@ -188,36 +191,36 @@ export const controlsChangeOf = (controls, inherited) => {
|
|
|
188
191
|
return constUndefined;
|
|
189
192
|
return change;
|
|
190
193
|
};
|
|
191
|
-
/** Whether
|
|
194
|
+
/** Whether a Subject is a **Variant child** (CONTEXT.md). */
|
|
192
195
|
export const isVariantChild = (config) => Predicate.isNotUndefined(config.variants) && !namesOwnVariants(config) && config.inherit !== false;
|
|
193
|
-
/** The context
|
|
196
|
+
/** The context a Subject inherits names and its default transition from: its parent's, for a Variant child. */
|
|
194
197
|
export const inheritedContext = (config, parent) => {
|
|
195
|
-
// Per
|
|
198
|
+
// Per Subject at mount (#540): statements.
|
|
196
199
|
if (isVariantChild(config))
|
|
197
200
|
return parent;
|
|
198
201
|
return undefined;
|
|
199
202
|
};
|
|
200
203
|
/**
|
|
201
|
-
* The `initial`
|
|
204
|
+
* The `initial` a Subject's Starting style resolves: its own, else the `initial` name (or `false`) of
|
|
202
205
|
* the context it inherits from (#50, #134). Read once, as every `initial` is.
|
|
203
206
|
*/
|
|
204
207
|
export const initialOf = (config, inherited) => UndefinedOr.match(config.initial, {
|
|
205
208
|
onDefined: (initial) => initial,
|
|
206
209
|
onUndefined: () => UndefinedOr.match(inherited, { onUndefined: constUndefined, onDefined: (context) => context.initial }),
|
|
207
210
|
});
|
|
208
|
-
/** The `animate`
|
|
211
|
+
/** The `animate` a Subject starts at with `initial={false}`: its own, else the name its context hands down (#134). Read once, untracked. */
|
|
209
212
|
const animateOf = (config, inherited, untrack) => UndefinedOr.match(config.animate, {
|
|
210
213
|
onDefined: (animate) => animate,
|
|
211
214
|
onUndefined: () => UndefinedOr.match(inherited, { onUndefined: constUndefined, onDefined: (context) => untrack(context.variant) }),
|
|
212
215
|
});
|
|
213
216
|
/**
|
|
214
|
-
* Whether
|
|
217
|
+
* Whether a Subject starts at its `animate`, with nothing animating at mount (#134, Motion's
|
|
215
218
|
* `isInitialAnimationBlocked`): its `initial` (own or inherited) is `false`, or it renders with an
|
|
216
219
|
* `<AnimatePresence initial={false}>`'s first render (`presenceBlocks`).
|
|
217
220
|
*/
|
|
218
221
|
export const startsAtAnimate = (config, inherited, presenceBlocks) => presenceBlocks || initialOf(config, inherited) === false;
|
|
219
222
|
/**
|
|
220
|
-
* Whether
|
|
223
|
+
* Whether a Subject's mount tells nothing (#448, Motion's `animation-state.ts`): it
|
|
221
224
|
* {@link startsAtAnimate}, or its `initial` (own, else inherited) is the same name, list or values map
|
|
222
225
|
* as its `animate` (own, else inherited). Its first Retarget, landing with nothing to animate, is told
|
|
223
226
|
* to no one. Read once, untracked.
|
|
@@ -232,15 +235,28 @@ export const startsQuiet = (config, inherited, presenceBlocks, untrack) => {
|
|
|
232
235
|
return VariantTarget.sameLabels(initial, animateOf(config, inherited, untrack));
|
|
233
236
|
};
|
|
234
237
|
/**
|
|
235
|
-
* The values
|
|
238
|
+
* The values a Subject starts from, its Starting style's input (ADR-0003): its `initial` (own, else
|
|
236
239
|
* inherited, #50), or, when it {@link startsAtAnimate}, its `animate` (own, else inherited), as
|
|
237
240
|
* Motion's `initial={false}` (#134). Read once: an inherited name is read through `untrack`.
|
|
238
241
|
*/
|
|
239
|
-
export const startingValuesOf = (config, inherited, presenceBlocks, untrack) =>
|
|
242
|
+
export const startingValuesOf = (config, inherited, presenceBlocks, untrack) => startingValuesFrom(config, inherited, presenceBlocks, untrack, VariantTarget.startingVariantsOf(config.variants, config.custom).variants);
|
|
243
|
+
/**
|
|
244
|
+
* {@link startingValuesOf}, with what a resolver among the Subject's variants threw: its entry gives no
|
|
245
|
+
* values, and the Subject starts at the rest (#979).
|
|
246
|
+
*/
|
|
247
|
+
export const startingOf = (config, inherited, presenceBlocks, untrack) => {
|
|
248
|
+
const variants = VariantTarget.startingVariantsOf(config.variants, config.custom);
|
|
249
|
+
return { values: startingValuesFrom(config, inherited, presenceBlocks, untrack, variants.variants), failure: variants.failure };
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* {@link startingValuesOf} from its variants already resolved to values (`VariantTarget.startingVariantsOf`):
|
|
253
|
+
* what a Subject's start reads, which reads their failure too.
|
|
254
|
+
*/
|
|
255
|
+
export const startingValuesFrom = (config, inherited, presenceBlocks, untrack, variants) => {
|
|
240
256
|
const atAnimate = startsAtAnimate(config, inherited, presenceBlocks);
|
|
241
257
|
const animate = animateOf(config, inherited, untrack);
|
|
242
258
|
const initial = initialOf(config, inherited);
|
|
243
|
-
// Per
|
|
259
|
+
// Per Subject at mount (#540): statements. Starting at `animate` resolves as `initial={false}`,
|
|
244
260
|
// and its first target is `animate`.
|
|
245
261
|
let from = initial;
|
|
246
262
|
let first = initial;
|
|
@@ -248,11 +264,11 @@ export const startingValuesOf = (config, inherited, presenceBlocks, untrack) =>
|
|
|
248
264
|
from = false;
|
|
249
265
|
first = animate;
|
|
250
266
|
}
|
|
267
|
+
// Dynamic variants resolved first (#277): `@wardic/dom`'s Starting style reads values maps only.
|
|
251
268
|
const values = Stops.resolveInitial({
|
|
252
269
|
initial: from,
|
|
253
270
|
animate,
|
|
254
|
-
|
|
255
|
-
variants: VariantTarget.startingVariantsOf(config.variants, config.custom),
|
|
271
|
+
variants: variants,
|
|
256
272
|
});
|
|
257
273
|
// The first target's Transition end (#428, Motion's `makeLatestValues`): set at once, so a server
|
|
258
274
|
// renders it, and a hydration finds it.
|
|
@@ -264,16 +280,16 @@ export const startingValuesOf = (config, inherited, presenceBlocks, untrack) =>
|
|
|
264
280
|
return { ...values, ...end };
|
|
265
281
|
};
|
|
266
282
|
/**
|
|
267
|
-
* A name
|
|
283
|
+
* A name a Subject hands its children (Motion's `getCurrentTreeVariants`): `own` if it names its own
|
|
268
284
|
* variants, else `fromParent` unless it sets `inherit={false}`.
|
|
269
285
|
*/
|
|
270
286
|
export const handedDown = (config, own, fromParent) => Bool.match(namesOwnVariants(config), {
|
|
271
287
|
onTrue: own,
|
|
272
288
|
onFalse: () => Bool.match(config.inherit === false, { onTrue: constUndefined, onFalse: fromParent }),
|
|
273
289
|
});
|
|
274
|
-
/**
|
|
290
|
+
/** A Subject's own transition, else the one it inherits. */
|
|
275
291
|
export const ownOrInherited = (own, inherited) => UndefinedOr.match(own, { onUndefined: () => UndefinedOr.map(inherited, (context) => context.transition()), onDefined: identity });
|
|
276
|
-
/** The stagger config
|
|
292
|
+
/** The stagger config a Subject's `transition` gives its Variant children. */
|
|
277
293
|
export const staggerOf = (transition) => UndefinedOr.match(transition, { onUndefined: () => staggerWith({}), onDefined: staggerWith });
|
|
278
294
|
/** A context's stagger config for one of its names (#297): its `staggerFor`'s, else its whole orchestration's. */
|
|
279
295
|
export const staggerOfName = (context, name) => {
|
|
@@ -295,17 +311,48 @@ export const directed = (index, total, direction) => {
|
|
|
295
311
|
return total - 1 - index;
|
|
296
312
|
return index;
|
|
297
313
|
};
|
|
314
|
+
/** The runtime a server render reports on: Effect's default, as a server holds no app reporters. */
|
|
315
|
+
export const ON_SERVER = { runFork: (effect) => Effect.runFork(effect) };
|
|
316
|
+
/** One exit's or one render's {@link DelayFailures}, reported on `runtime` at its first throw. */
|
|
317
|
+
export const eventDelayFailuresOf = (runtime) => ({ delayFailing: false, runtime, event: true });
|
|
298
318
|
/**
|
|
299
319
|
* A child's delay in a stagger (ADR-0007): its `delayChildren` plus its place from the origin, turned
|
|
300
320
|
* by its `staggerDirection`. A function `delayChildren` (#436, Motion's `calcChildStagger`) decides it
|
|
301
|
-
* whole, from the child's index and the count
|
|
302
|
-
*
|
|
321
|
+
* whole, from the child's index and the count; one that throws gives the child no delay, reported on
|
|
322
|
+
* `failures` (on Effect's default runtime with none) at the first throw of a run of them. Every stagger,
|
|
323
|
+
* a Variant child's, a presence's exit's and a server's Appear timing, is placed by it.
|
|
303
324
|
*/
|
|
304
|
-
export const childDelayOf = (s, index, total) => {
|
|
325
|
+
export const childDelayOf = (s, index, total, failures) => {
|
|
305
326
|
if (Predicate.isFunction(s.delayChildren))
|
|
306
|
-
return s.delayChildren
|
|
327
|
+
return calledDelayOf(s.delayChildren, index, total, failures);
|
|
307
328
|
return s.delayChildren + Stagger.make(s.amount, { from: s.from })(directed(index, total, s.direction), total);
|
|
308
329
|
};
|
|
330
|
+
// #979 (ADR-0074, row 43, found by group H's probe): a `delayChildren` function is the app's, called at each
|
|
331
|
+
// child's Retarget, exit and Appear timing with no try. A throw halted Solid 2, came out of Solid 1's
|
|
332
|
+
// setter, and skipped Foldkit's later watches at a patch.
|
|
333
|
+
const DELAY_FAILED = "wardic.stagger: a delayChildren function failed";
|
|
334
|
+
/** `delayChildren` called for a child, a throw its child's: no delay, reported once a run on `failures`. */
|
|
335
|
+
// A child's run is its Subject's, whatever name it's staggered under: a parent's own transition staggers
|
|
336
|
+
// every name with one function, so a run kept by name would report it again for each. (The review's: a
|
|
337
|
+
// child staggered under two names at once, one function throwing and one not, is reported at each change.)
|
|
338
|
+
const calledDelayOf = (delayChildren, index, total, failures) => {
|
|
339
|
+
try {
|
|
340
|
+
const delay = delayChildren(index, total);
|
|
341
|
+
if (Predicate.isNotUndefined(failures) && failures.delayFailing && failures.event !== true)
|
|
342
|
+
failures.delayFailing = false;
|
|
343
|
+
return delay;
|
|
344
|
+
}
|
|
345
|
+
catch (defect) {
|
|
346
|
+
if (Predicate.isUndefined(failures)) {
|
|
347
|
+
Report.failureOn(undefined, DELAY_FAILED, Cause.die(defect), { index });
|
|
348
|
+
return 0;
|
|
349
|
+
}
|
|
350
|
+
if (!failures.delayFailing)
|
|
351
|
+
failures.runtime.runFork(Report.failure(DELAY_FAILED, Cause.die(defect)).pipe(Effect.annotateLogs({ index })));
|
|
352
|
+
failures.delayFailing = true;
|
|
353
|
+
return 0;
|
|
354
|
+
}
|
|
355
|
+
};
|
|
309
356
|
/** A {@link NameConfig} from the transition a name orchestrates on. */
|
|
310
357
|
export const nameConfigOf = (transition) => ({
|
|
311
358
|
stagger: staggerOf(transition),
|
|
@@ -324,7 +371,7 @@ export const staggerWith = ({ staggerChildren = 0, delayChildren = 0, from = "fi
|
|
|
324
371
|
* pressed, made a new, equal config at each press and release, `UNSTABLE_MEMO_OUTPUT`).
|
|
325
372
|
*/
|
|
326
373
|
export const sameStagger = (a, b) => a.amount === b.amount && a.delayChildren === b.delayChildren && a.from === b.from && a.direction === b.direction;
|
|
327
|
-
/** What
|
|
374
|
+
/** What a Subject provides when it has no variants of its own: its parent's context, unless `inherit={false}`. */
|
|
328
375
|
export const passedThrough = (config, parent) => Bool.match(config.inherit === false, { onTrue: constUndefined, onFalse: () => parent });
|
|
329
376
|
/** A registration that does nothing: a server render has no orchestration to join. */
|
|
330
377
|
export const INERT_REGISTRATION = Object.freeze({
|