@wardic/dom 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DomProjectionSystem.js +3 -3
- package/dist/DomProjectionSystem.js.map +1 -1
- package/dist/FlushGate.d.ts +6 -6
- package/dist/FlushGate.d.ts.map +1 -1
- package/dist/FlushGate.js +7 -5
- package/dist/FlushGate.js.map +1 -1
- package/dist/ReorderController.js +3 -3
- package/dist/ReorderController.js.map +1 -1
- package/dist/Report.d.ts +1 -1
- package/dist/Report.d.ts.map +1 -1
- package/dist/Report.js +3 -2
- package/dist/Report.js.map +1 -1
- package/dist/Style.d.ts +2 -1
- package/dist/Style.d.ts.map +1 -1
- package/dist/Style.js +3 -1
- package/dist/Style.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/batch-handoff.d.ts +25 -0
- package/dist/internal/batch-handoff.d.ts.map +1 -0
- package/dist/internal/batch-handoff.js +64 -0
- package/dist/internal/batch-handoff.js.map +1 -0
- package/dist/internal/gate-environment.d.ts +4 -0
- package/dist/internal/gate-environment.d.ts.map +1 -0
- package/dist/internal/gate-environment.js +21 -0
- package/dist/internal/gate-environment.js.map +1 -0
- package/dist/internal/projection.js +14 -14
- package/dist/internal/projection.js.map +1 -1
- package/dist/internal/reorder.d.ts +2 -2
- package/dist/internal/reorder.d.ts.map +1 -1
- package/dist/internal/reorder.js +2 -2
- package/dist/internal/reorder.js.map +1 -1
- package/dist/internal/starting-style.d.ts +0 -83
- package/dist/internal/starting-style.d.ts.map +1 -1
- package/dist/internal/starting-style.js +16 -143
- package/dist/internal/starting-style.js.map +1 -1
- package/dist/unstable/AppearAnimations.d.ts +191 -0
- package/dist/unstable/AppearAnimations.d.ts.map +1 -0
- package/dist/unstable/AppearAnimations.js +561 -0
- package/dist/unstable/AppearAnimations.js.map +1 -0
- package/dist/unstable/BatchMembers.d.ts +513 -0
- package/dist/unstable/BatchMembers.d.ts.map +1 -0
- package/dist/unstable/BatchMembers.js +2490 -0
- package/dist/unstable/BatchMembers.js.map +1 -0
- package/dist/unstable/DomValues.d.ts +25 -0
- package/dist/unstable/DomValues.d.ts.map +1 -0
- package/dist/unstable/DomValues.js +45 -0
- package/dist/unstable/DomValues.js.map +1 -0
- package/dist/unstable/DragConstraints.d.ts +48 -0
- package/dist/unstable/DragConstraints.d.ts.map +1 -0
- package/dist/unstable/DragConstraints.js +49 -0
- package/dist/unstable/DragConstraints.js.map +1 -0
- package/dist/unstable/DragControls.d.ts +50 -0
- package/dist/unstable/DragControls.d.ts.map +1 -0
- package/dist/unstable/DragControls.js +55 -0
- package/dist/unstable/DragControls.js.map +1 -0
- package/dist/unstable/DragDefaults.d.ts +34 -0
- package/dist/unstable/DragDefaults.d.ts.map +1 -0
- package/dist/unstable/DragDefaults.js +47 -0
- package/dist/unstable/DragDefaults.js.map +1 -0
- package/dist/unstable/DragTrack.d.ts +236 -0
- package/dist/unstable/DragTrack.d.ts.map +1 -0
- package/dist/unstable/DragTrack.js +646 -0
- package/dist/unstable/DragTrack.js.map +1 -0
- package/dist/unstable/DragTransition.d.ts +22 -0
- package/dist/unstable/DragTransition.d.ts.map +1 -0
- package/dist/unstable/DragTransition.js +31 -0
- package/dist/unstable/DragTransition.js.map +1 -0
- package/dist/unstable/ElementSetup.d.ts +144 -0
- package/dist/unstable/ElementSetup.d.ts.map +1 -0
- package/dist/unstable/ElementSetup.js +297 -0
- package/dist/unstable/ElementSetup.js.map +1 -0
- package/dist/unstable/Feature.d.ts +221 -0
- package/dist/unstable/Feature.d.ts.map +1 -0
- package/dist/unstable/Feature.js +281 -0
- package/dist/unstable/Feature.js.map +1 -0
- package/dist/unstable/GestureFeatures.d.ts +30 -0
- package/dist/unstable/GestureFeatures.d.ts.map +1 -0
- package/dist/unstable/GestureFeatures.js +32 -0
- package/dist/unstable/GestureFeatures.js.map +1 -0
- package/dist/unstable/GestureInfo.d.ts +61 -0
- package/dist/unstable/GestureInfo.d.ts.map +1 -0
- package/dist/unstable/GestureInfo.js +23 -0
- package/dist/unstable/GestureInfo.js.map +1 -0
- package/dist/unstable/Imperative.d.ts +214 -0
- package/dist/unstable/Imperative.d.ts.map +1 -0
- package/dist/unstable/Imperative.js +768 -0
- package/dist/unstable/Imperative.js.map +1 -0
- package/dist/unstable/Instant.d.ts +46 -0
- package/dist/unstable/Instant.d.ts.map +1 -0
- package/dist/unstable/Instant.js +49 -0
- package/dist/unstable/Instant.js.map +1 -0
- package/dist/unstable/LayoutGroup.d.ts +14 -0
- package/dist/unstable/LayoutGroup.d.ts.map +1 -0
- package/dist/unstable/LayoutGroup.js +31 -0
- package/dist/unstable/LayoutGroup.js.map +1 -0
- package/dist/unstable/LayoutMember.d.ts +127 -0
- package/dist/unstable/LayoutMember.d.ts.map +1 -0
- package/dist/unstable/LayoutMember.js +176 -0
- package/dist/unstable/LayoutMember.js.map +1 -0
- package/dist/unstable/LiveStyle.d.ts +171 -0
- package/dist/unstable/LiveStyle.d.ts.map +1 -0
- package/dist/unstable/LiveStyle.js +329 -0
- package/dist/unstable/LiveStyle.js.map +1 -0
- package/dist/unstable/MemberHold.d.ts +3 -0
- package/dist/unstable/MemberHold.d.ts.map +1 -0
- package/dist/unstable/MemberHold.js +223 -0
- package/dist/unstable/MemberHold.js.map +1 -0
- package/dist/unstable/OwnerScope.d.ts +16 -0
- package/dist/unstable/OwnerScope.d.ts.map +1 -0
- package/dist/unstable/OwnerScope.js +35 -0
- package/dist/unstable/OwnerScope.js.map +1 -0
- package/dist/unstable/PresenceController.d.ts +128 -0
- package/dist/unstable/PresenceController.d.ts.map +1 -0
- package/dist/unstable/PresenceController.js +1427 -0
- package/dist/unstable/PresenceController.js.map +1 -0
- package/dist/unstable/Press.d.ts +26 -0
- package/dist/unstable/Press.d.ts.map +1 -0
- package/dist/unstable/Press.js +19 -0
- package/dist/unstable/Press.js.map +1 -0
- package/dist/unstable/ServerInterpolators.d.ts +17 -0
- package/dist/unstable/ServerInterpolators.d.ts.map +1 -0
- package/dist/unstable/ServerInterpolators.js +20 -0
- package/dist/unstable/ServerInterpolators.js.map +1 -0
- package/dist/unstable/WardConfig.d.ts +567 -0
- package/dist/unstable/WardConfig.d.ts.map +1 -0
- package/dist/unstable/WardConfig.js +2 -0
- package/dist/unstable/WardConfig.js.map +1 -0
- package/dist/unstable/features/All.d.ts +24 -0
- package/dist/unstable/features/All.d.ts.map +1 -0
- package/dist/unstable/features/All.js +20 -0
- package/dist/unstable/features/All.js.map +1 -0
- package/dist/unstable/features/Colors.d.ts +12 -0
- package/dist/unstable/features/Colors.d.ts.map +1 -0
- package/dist/unstable/features/Colors.js +38 -0
- package/dist/unstable/features/Colors.js.map +1 -0
- package/dist/unstable/features/DomAnimation.d.ts +16 -0
- package/dist/unstable/features/DomAnimation.d.ts.map +1 -0
- package/dist/unstable/features/DomAnimation.js +19 -0
- package/dist/unstable/features/DomAnimation.js.map +1 -0
- package/dist/unstable/features/DomMax.d.ts +12 -0
- package/dist/unstable/features/DomMax.d.ts.map +1 -0
- package/dist/unstable/features/DomMax.js +14 -0
- package/dist/unstable/features/DomMax.js.map +1 -0
- package/dist/unstable/features/Drag.d.ts +5 -0
- package/dist/unstable/features/Drag.d.ts.map +1 -0
- package/dist/unstable/features/Drag.js +32 -0
- package/dist/unstable/features/Drag.js.map +1 -0
- package/dist/unstable/features/Focus.d.ts +5 -0
- package/dist/unstable/features/Focus.d.ts.map +1 -0
- package/dist/unstable/features/Focus.js +20 -0
- package/dist/unstable/features/Focus.js.map +1 -0
- package/dist/unstable/features/Hover.d.ts +5 -0
- package/dist/unstable/features/Hover.d.ts.map +1 -0
- package/dist/unstable/features/Hover.js +20 -0
- package/dist/unstable/features/Hover.js.map +1 -0
- package/dist/unstable/features/InView.d.ts +5 -0
- package/dist/unstable/features/InView.d.ts.map +1 -0
- package/dist/unstable/features/InView.js +20 -0
- package/dist/unstable/features/InView.js.map +1 -0
- package/dist/unstable/features/Input.d.ts +28 -0
- package/dist/unstable/features/Input.d.ts.map +1 -0
- package/dist/unstable/features/Input.js +31 -0
- package/dist/unstable/features/Input.js.map +1 -0
- package/dist/unstable/features/Keys.d.ts +95 -0
- package/dist/unstable/features/Keys.d.ts.map +1 -0
- package/dist/unstable/features/Keys.js +44 -0
- package/dist/unstable/features/Keys.js.map +1 -0
- package/dist/unstable/features/Layout.d.ts +43 -0
- package/dist/unstable/features/Layout.d.ts.map +1 -0
- package/dist/unstable/features/Layout.js +44 -0
- package/dist/unstable/features/Layout.js.map +1 -0
- package/dist/unstable/features/Pan.d.ts +5 -0
- package/dist/unstable/features/Pan.d.ts.map +1 -0
- package/dist/unstable/features/Pan.js +20 -0
- package/dist/unstable/features/Pan.js.map +1 -0
- package/dist/unstable/features/Press.d.ts +13 -0
- package/dist/unstable/features/Press.d.ts.map +1 -0
- package/dist/unstable/features/Press.js +10 -0
- package/dist/unstable/features/Press.js.map +1 -0
- package/dist/unstable/features/Scroll.d.ts +20 -0
- package/dist/unstable/features/Scroll.d.ts.map +1 -0
- package/dist/unstable/features/Scroll.js +34 -0
- package/dist/unstable/features/Scroll.js.map +1 -0
- package/dist/unstable/features/TimelineKeys.d.ts +7 -0
- package/dist/unstable/features/TimelineKeys.d.ts.map +1 -0
- package/dist/unstable/features/TimelineKeys.js +103 -0
- package/dist/unstable/features/TimelineKeys.js.map +1 -0
- package/package.json +4 -3
- package/src/DomProjectionSystem.ts +3 -3
- package/src/FlushGate.ts +11 -9
- package/src/ReorderController.ts +3 -3
- package/src/Report.ts +3 -7
- package/src/Style.ts +4 -1
- package/src/index.ts +1 -1
- package/src/internal/batch-handoff.ts +75 -0
- package/src/internal/gate-environment.ts +21 -0
- package/src/internal/projection.ts +14 -14
- package/src/internal/reorder.ts +4 -4
- package/src/internal/starting-style.ts +5 -204
- package/src/unstable/AppearAnimations.ts +837 -0
- package/src/unstable/BatchMembers.ts +3085 -0
- package/src/unstable/DomValues.ts +53 -0
- package/src/unstable/DragConstraints.ts +107 -0
- package/src/unstable/DragControls.ts +98 -0
- package/src/unstable/DragDefaults.ts +57 -0
- package/src/unstable/DragTrack.ts +959 -0
- package/src/unstable/DragTransition.ts +46 -0
- package/src/unstable/ElementSetup.ts +411 -0
- package/src/unstable/Feature.ts +494 -0
- package/src/unstable/GestureFeatures.ts +38 -0
- package/src/unstable/GestureInfo.ts +85 -0
- package/src/unstable/Imperative.ts +1037 -0
- package/src/unstable/Instant.ts +93 -0
- package/src/unstable/LayoutGroup.ts +36 -0
- package/src/unstable/LayoutMember.ts +319 -0
- package/src/unstable/LiveStyle.ts +497 -0
- package/src/unstable/MemberHold.ts +211 -0
- package/src/unstable/OwnerScope.ts +35 -0
- package/src/unstable/PresenceController.ts +1747 -0
- package/src/unstable/Press.ts +43 -0
- package/src/unstable/ServerInterpolators.ts +39 -0
- package/src/unstable/WardConfig.ts +704 -0
- package/src/unstable/features/All.ts +39 -0
- package/src/unstable/features/Colors.ts +40 -0
- package/src/unstable/features/DomAnimation.ts +19 -0
- package/src/unstable/features/DomMax.ts +14 -0
- package/src/unstable/features/Drag.ts +34 -0
- package/src/unstable/features/Focus.ts +21 -0
- package/src/unstable/features/Hover.ts +21 -0
- package/src/unstable/features/InView.ts +21 -0
- package/src/unstable/features/Input.ts +37 -0
- package/src/unstable/features/Keys.ts +124 -0
- package/src/unstable/features/Layout.ts +75 -0
- package/src/unstable/features/Pan.ts +21 -0
- package/src/unstable/features/Press.ts +21 -0
- package/src/unstable/features/Scroll.ts +35 -0
- package/src/unstable/features/TimelineKeys.ts +115 -0
- package/dist/internal/gate.d.ts +0 -199
- package/dist/internal/gate.d.ts.map +0 -1
- package/dist/internal/gate.js +0 -570
- package/dist/internal/gate.js.map +0 -1
- package/dist/internal/report.d.ts +0 -30
- package/dist/internal/report.d.ts.map +0 -1
- package/dist/internal/report.js +0 -60
- package/dist/internal/report.js.map +0 -1
- package/dist/internal/runner.d.ts +0 -22
- package/dist/internal/runner.d.ts.map +0 -1
- package/dist/internal/runner.js +0 -62
- package/dist/internal/runner.js.map +0 -1
- package/src/internal/gate.ts +0 -706
- package/src/internal/report.ts +0 -69
- package/src/internal/runner.ts +0 -78
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import type * as InterpolatorRegistry from "@wardic/core/InterpolatorRegistry";
|
|
2
|
+
import * as LiveValue from "@wardic/core/LiveValue";
|
|
3
|
+
import type * as Values from "@wardic/core/Values";
|
|
4
|
+
import type * as OwnValues from "@wardic/core/unstable/OwnValues";
|
|
5
|
+
import type * as Effect from "effect/Effect";
|
|
6
|
+
import * as Option from "effect/Option";
|
|
7
|
+
import * as Atom from "effect/reactivity/Atom";
|
|
8
|
+
import * as AtomRegistry from "effect/reactivity/AtomRegistry";
|
|
9
|
+
import type * as Config from "@wardic/core/unstable/Config";
|
|
10
|
+
import type * as Reactivity from "@wardic/core/unstable/Reactivity";
|
|
11
|
+
import type * as RetargetLegs from "@wardic/core/unstable/RetargetLegs";
|
|
12
|
+
import type * as WardicServices from "@wardic/core/unstable/WardicServices";
|
|
13
|
+
/**
|
|
14
|
+
* A live value as a binding takes it: an accessor, such as a signal, a memo or another live value, or an
|
|
15
|
+
* `effect/reactivity` Atom. An element's `style` follows it, and the `create*` live values take it.
|
|
16
|
+
*/
|
|
17
|
+
export type LiveSource<A> = Atom.Atom<A> | Reactivity.Accessor<A>;
|
|
18
|
+
/** A `style` value: a plain value, or a live one ({@link LiveSource}), which the element follows. */
|
|
19
|
+
export type Live<A> = A | LiveSource<A>;
|
|
20
|
+
/** A user's style as a binding hands it over: a record, CSS text, or none. */
|
|
21
|
+
type StyleInput = object | string | undefined;
|
|
22
|
+
/** Whether a style value is live: an Atom, or an accessor. */
|
|
23
|
+
export declare const isLive: (value: unknown) => value is LiveSource<unknown>;
|
|
24
|
+
/**
|
|
25
|
+
* `accessor`, carrying `atom`: the Atom it reads, so a `style` that's given it follows the Atom
|
|
26
|
+
* itself, set where the Atom is, rather than the accessor through Solid (#209 PR 3's Q2). On Solid
|
|
27
|
+
* 2 an accessor's change shows at Solid's flush, after the gate's write: a value derived from a
|
|
28
|
+
* ward's would paint a frame late. Both must give the same value.
|
|
29
|
+
*/
|
|
30
|
+
export declare const carry: <A>(accessor: Reactivity.Accessor<A>, atom: Atom.Atom<A>) => Reactivity.Accessor<A>;
|
|
31
|
+
/**
|
|
32
|
+
* `createFollowValue`'s transition, in seconds: a spring (with no `type`), a tween or an inertia, an
|
|
33
|
+
* inertia's `timeConstant` in milliseconds, as a `transition`'s; and `skipInitialAnimation`, to make
|
|
34
|
+
* the source's first change a jump. Motion's `FollowValueOptions`.
|
|
35
|
+
*/
|
|
36
|
+
export type FollowValueOptions = (Exclude<LiveValue.FollowTransition, {
|
|
37
|
+
readonly type: "inertia";
|
|
38
|
+
}> | Config.WardicInertia) & LiveValue.FollowSkips;
|
|
39
|
+
/** `options` as core's `LiveValue.follow` takes them: an inertia's `timeConstant` in seconds. */
|
|
40
|
+
export declare const followOptionsOf: (options: FollowValueOptions) => LiveValue.FollowOptions;
|
|
41
|
+
/**
|
|
42
|
+
* A followed value, as an accessor: a number, or a string with its unit, as its source is. Its `jump`
|
|
43
|
+
* puts it somewhere at once.
|
|
44
|
+
*/
|
|
45
|
+
export interface FollowAccessor<A extends number | string = number> extends Reactivity.Accessor<A> {
|
|
46
|
+
/**
|
|
47
|
+
* Set it to `value` at once, not as motion (Motion's `MotionValue.jump`): its run ends there with
|
|
48
|
+
* no velocity, and it rests there until its source next changes, then animates from there. A
|
|
49
|
+
* `createVelocity` of it reads 0 across the jump. A string's number is read as the follow reads
|
|
50
|
+
* its source's, and shown with the follow's unit. On a server, it does nothing.
|
|
51
|
+
*/
|
|
52
|
+
jump(value: A): void;
|
|
53
|
+
}
|
|
54
|
+
/** `createSpring`'s value: a spring's {@link FollowAccessor}. */
|
|
55
|
+
export type SpringAccessor<A extends number | string = number> = FollowAccessor<A>;
|
|
56
|
+
/** A unit string's unit, as Motion's follower reads it (#441): what's left after its digits, `.` and `-`. */
|
|
57
|
+
export declare const unitOf: (value: string) => string;
|
|
58
|
+
/**
|
|
59
|
+
* `numbers`, a follow of a unit string's numbers, shown with `unit` (#441, Motion's follower: the
|
|
60
|
+
* unit its source started with, whatever a later one says). Its `jump` reaches `numbers`.
|
|
61
|
+
*/
|
|
62
|
+
export declare const withUnit: (unit: string) => (numbers: Atom.Atom<number>) => Atom.Atom<string>;
|
|
63
|
+
/** A value a follow reads: a number as it is, a string as `parseFloat` reads it, as Motion's follower does. */
|
|
64
|
+
export declare const numberOf: (value: number | string) => number;
|
|
65
|
+
/** `accessor`, carrying a follow's Atom, with `jump` run on `runtime`. */
|
|
66
|
+
export declare const followAccessorOf: <A extends number | string>(runtime: WardicServices.Runner<WardicServices.WardicServices>, accessor: Reactivity.Accessor<A>) => FollowAccessor<A>;
|
|
67
|
+
/** A server's follow: `read`, as it is now, and a `jump` that does nothing (ADR-0021). */
|
|
68
|
+
export declare const serverFollowOf: <A extends number | string>(read: Reactivity.Accessor<A>) => FollowAccessor<A>;
|
|
69
|
+
/** The Atom a Live value is, or carries: `undefined` for a plain accessor or a plain value. Per key, per change: guards, no matcher. */
|
|
70
|
+
export declare const atomOf: (value: unknown) => Atom.Atom<unknown> | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* `source` mapped through ranges by core (`LiveValue.transform`), for `createTransform` on an Atom: set
|
|
73
|
+
* where `source` is, and, when `source` derives from a scroll, described so an element runs it as a
|
|
74
|
+
* Timeline value (#240). Typed at `createTransform`'s overloads: numbers and strings through the
|
|
75
|
+
* registry, any type through a `mixer`.
|
|
76
|
+
*/
|
|
77
|
+
export declare const rangesOf: (source: Atom.Atom<unknown>, input: ReadonlyArray<number>, output: ReadonlyArray<unknown>, options: LiveValue.TransformOptions<unknown> | undefined) => Effect.Effect<Atom.Atom<unknown>, never, InterpolatorRegistry.InterpolatorRegistry>;
|
|
78
|
+
/** Whether `key` is a transform key, composed into `transform` (`x`, `scale`, `rotate`…). */
|
|
79
|
+
export declare const isTransformKey: (key: string) => boolean;
|
|
80
|
+
/** A style value, read now: an Atom (or the one an accessor carries) through `registry`, an accessor untracked, anything else as it is. */
|
|
81
|
+
export declare const readLive: (value: unknown, registry: () => AtomRegistry.AtomRegistry, untrack: Reactivity.Reactivity["untrack"]) => unknown;
|
|
82
|
+
/** A user's style split: what its binding's `style` carries, and the routed keys' sources. */
|
|
83
|
+
export interface Split {
|
|
84
|
+
/** The style without the routed keys. The user's own when nothing is routed. */
|
|
85
|
+
readonly css: StyleInput;
|
|
86
|
+
/** Each routed key's value as given: an Atom, an accessor, or a transform key's plain value. */
|
|
87
|
+
readonly routed: Readonly<Record<string, unknown>>;
|
|
88
|
+
/** Whether a `transform` string was dropped for the transform keys. */
|
|
89
|
+
readonly droppedTransform: boolean;
|
|
90
|
+
}
|
|
91
|
+
/** A user's style, split into its binding's part and the routed keys (its text form read by its Environment's `ownValues`). */
|
|
92
|
+
export declare const split: (user: StyleInput, ownValues: OwnValues.Shape) => Split;
|
|
93
|
+
/** The routed keys' values, read now: the numbers and strings among them, as a values map. */
|
|
94
|
+
export declare const valuesOf: (routed: Readonly<Record<string, unknown>>, registry: () => AtomRegistry.AtomRegistry, untrack: Reactivity.Reactivity["untrack"]) => Values.Values;
|
|
95
|
+
/** What the spine hears while it follows. */
|
|
96
|
+
export interface Follower {
|
|
97
|
+
/** A routed key's value changed, or its source did: `value` is its value now. */
|
|
98
|
+
readonly change: (key: string, value: unknown) => void;
|
|
99
|
+
/** A routed key left the style. */
|
|
100
|
+
readonly removed: (key: string) => void;
|
|
101
|
+
}
|
|
102
|
+
/** An element's routed `style` keys, seen through its `style` and followed from mount. */
|
|
103
|
+
export interface LiveStyle {
|
|
104
|
+
/** Sees the user's `style` (reconciling the routed keys), and gives the binding's part of it. Called where the binding reads it reactively. */
|
|
105
|
+
readonly css: (user: StyleInput) => StyleInput;
|
|
106
|
+
/** The routed keys' values now, as a values map: the Starting style's. */
|
|
107
|
+
readonly values: () => Values.Values;
|
|
108
|
+
/** Whether `key` is routed now. */
|
|
109
|
+
readonly routes: (key: string) => boolean;
|
|
110
|
+
/** A routed key's value now, `None` when it isn't routed. */
|
|
111
|
+
readonly valueOf: (key: string) => Option.Option<unknown>;
|
|
112
|
+
/** Whether a routed key's source is live, so a return to it follows it (decision 6). */
|
|
113
|
+
readonly isLive: (key: string) => boolean;
|
|
114
|
+
/** The Atom a routed key's source is or carries, which may describe a Timeline value (#240); `undefined` for none. */
|
|
115
|
+
readonly atomOf: (key: string) => Atom.Atom<unknown> | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* Its `willChange`'s turn-on, when its style gives it a `createWillChange` value (#443), as
|
|
118
|
+
* `willChange` or `will-change`; `undefined` otherwise, at once for a style that routes nothing.
|
|
119
|
+
*/
|
|
120
|
+
readonly willChange: () => (() => void) | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* Told the legs a Retarget starts: turns its element's will-change on (#443, Motion's
|
|
123
|
+
* `addValueToWillChange`) when its style gives it a `createWillChange` value and one of `legs`
|
|
124
|
+
* animates a transform key or another the compositor draws. A key already at its target starts no
|
|
125
|
+
* leg (#448), and a layout animation runs none, so neither does. Per start: a lookup in its routed
|
|
126
|
+
* keys, none for a style that routes nothing.
|
|
127
|
+
*/
|
|
128
|
+
readonly started: (legs: ReadonlyArray<RetargetLegs.Leg>) => void;
|
|
129
|
+
/** A style value read now, live or not. */
|
|
130
|
+
readonly read: (value: unknown) => unknown;
|
|
131
|
+
/**
|
|
132
|
+
* Follow, from the first routed key on: `setup` is called once, at once if a key is routed now,
|
|
133
|
+
* else when one first is, and the follower it gives hears every change from then on, until
|
|
134
|
+
* `stop`. Its first call is where the element's routed keys are first written. An element whose
|
|
135
|
+
* `style` never routes a key never calls it.
|
|
136
|
+
*/
|
|
137
|
+
readonly whenRouted: (setup: () => Follower) => void;
|
|
138
|
+
/** Stop following, and every watch with it. */
|
|
139
|
+
readonly stop: () => void;
|
|
140
|
+
}
|
|
141
|
+
/** What {@link createLiveStyle} reads. */
|
|
142
|
+
export interface LiveStyleOptions {
|
|
143
|
+
/** The registry Atoms are read through: the provider's on a client, a fresh one on a server. */
|
|
144
|
+
readonly registry: () => AtomRegistry.AtomRegistry;
|
|
145
|
+
/** Called once, the first time a `transform` string is dropped for the transform keys. */
|
|
146
|
+
readonly onDroppedTransform?: (() => void) | undefined;
|
|
147
|
+
/** The binding's reactivity: accessors are read untracked, and watched, through it (#209). */
|
|
148
|
+
readonly reactivity: Reactivity.Reactivity;
|
|
149
|
+
/** Its Environment's reads of its Subjects' own values (#672): a `style`'s text form read through them. */
|
|
150
|
+
readonly ownValues: OwnValues.Shape;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* An element's {@link LiveStyle}: one object, its methods shared, so an element that routes nothing
|
|
154
|
+
* pays for little more than it. Creates computations for accessors while it follows; their roots
|
|
155
|
+
* are its own. Call its methods on it (`live.read(v)`), not detached.
|
|
156
|
+
*/
|
|
157
|
+
export declare const createLiveStyle: (options: LiveStyleOptions) => LiveStyle;
|
|
158
|
+
/** A `createWillChange` value: `"auto"` until its element animates, then `"transform"`. */
|
|
159
|
+
export type WillChange = "auto" | "transform";
|
|
160
|
+
/**
|
|
161
|
+
* A `createWillChange` value (#443): its Atom, `"auto"`, held in `registry` until `onCleanup` runs,
|
|
162
|
+
* as an accessor `wrap` makes. Its turn-on sets it to `"transform"`, once, for good, as Motion's
|
|
163
|
+
* `WillChangeMotionValue` stays enabled. The accessor and its Atom are both marked, so a `style` that
|
|
164
|
+
* routes either finds it.
|
|
165
|
+
*/
|
|
166
|
+
export declare const willChangeOf: (registry: AtomRegistry.AtomRegistry, onCleanup: (fn: () => void) => void, wrap: (atom: Atom.Atom<WillChange>) => Reactivity.Accessor<WillChange>) => Reactivity.Accessor<WillChange>;
|
|
167
|
+
/** Whether animating `key` turns a will-change value on (#443). */
|
|
168
|
+
export declare const turnsWillChangeOn: (key: string) => boolean;
|
|
169
|
+
export declare const serverRegistryOf: () => AtomRegistry.AtomRegistry;
|
|
170
|
+
export {};
|
|
171
|
+
//# sourceMapping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2
|
+
* Live values in `style` (#130, ADR-0043): which of a user's `style` keys Wardic writes through the
|
|
3
|
+
* flush gate, what each is now, and when one changes.
|
|
4
|
+
*
|
|
5
|
+
* A key is **routed** when its value is live (an `effect/reactivity` Atom, or an accessor: a signal,
|
|
6
|
+
* a memo, `createTransform`'s) or when it's a transform key (`x`, `scale`, `rotate`…), live or not
|
|
7
|
+
* (decisions 2 and 4). A routed key is the key's `style` link, followed while no entry of the
|
|
8
|
+
* Override stack sets it (decision 1), and Wardic writes it: the gate composes the transform keys
|
|
9
|
+
* into `transform` with its own, and commits the rest once a frame. So the binding's `style` never
|
|
10
|
+
* carries one. A user's own `transform` string applies while no transform key is set; with one,
|
|
11
|
+
* the keys win (Motion's rule): the gate holds `transform`, so the binding never writes the string, and a
|
|
12
|
+
* warning is logged once per element.
|
|
13
|
+
*
|
|
14
|
+
* The binding reads its user's style reactively in one place, its element's `style`, so that's
|
|
15
|
+
* where `css` sees each new one. Following starts at mount, or at the first routed key after it
|
|
16
|
+
* (`whenRouted`): from then on, a change of a routed key's value, a new source for it, or its
|
|
17
|
+
* leaving the style, is told to the spine, which writes it while nothing else owns the key. An Atom is subscribed; an accessor gets its own
|
|
18
|
+
* computation, one per key, so a change runs only that.
|
|
19
|
+
*
|
|
20
|
+
* Every DOM binding runs it, each giving its own reactivity as a {@link Reactivity.Reactivity} (#209).
|
|
21
|
+
*
|
|
22
|
+
* Unstable, for Wardic's own packages: public, with no semver promise.
|
|
23
|
+
*
|
|
24
|
+
* @module
|
|
25
|
+
*/
|
|
26
|
+
// Unstable: ADR-0071, decision 5. #672 (PR3-Q1): solid's `live-style.ts`, the DOM's `style` prop, moved
|
|
27
|
+
// to dom for every DOM binding; the spine reads it through its LiveRoutes.
|
|
28
|
+
import * as BaseValue from "@wardic/core/BaseValue";
|
|
29
|
+
import * as LiveValue from "@wardic/core/LiveValue";
|
|
30
|
+
import * as Stops from "@wardic/core/unstable/Stops";
|
|
31
|
+
import * as Arr from "effect/Array";
|
|
32
|
+
import * as Bool from "effect/Boolean";
|
|
33
|
+
import { constVoid } from "effect/Function";
|
|
34
|
+
import * as Option from "effect/Option";
|
|
35
|
+
import * as Predicate from "effect/Predicate";
|
|
36
|
+
import * as Atom from "effect/reactivity/Atom";
|
|
37
|
+
import * as AtomRegistry from "effect/reactivity/AtomRegistry";
|
|
38
|
+
import * as Rec from "effect/Record";
|
|
39
|
+
import * as UndefinedOr from "effect/UndefinedOr";
|
|
40
|
+
/** Whether a style value is live: an Atom, or an accessor. */
|
|
41
|
+
export const isLive = (value) => Bool.or(Atom.isAtom(value), Predicate.isFunction(value));
|
|
42
|
+
/** Where an accessor keeps the Atom it carries (#209 PR 3's Q2). */
|
|
43
|
+
const CARRIED = Symbol.for("@wardic/dom/carried");
|
|
44
|
+
/**
|
|
45
|
+
* `accessor`, carrying `atom`: the Atom it reads, so a `style` that's given it follows the Atom
|
|
46
|
+
* itself, set where the Atom is, rather than the accessor through Solid (#209 PR 3's Q2). On Solid
|
|
47
|
+
* 2 an accessor's change shows at Solid's flush, after the gate's write: a value derived from a
|
|
48
|
+
* ward's would paint a frame late. Both must give the same value.
|
|
49
|
+
*/
|
|
50
|
+
export const carry = (accessor, atom) => Object.defineProperty(accessor, CARRIED, { value: atom });
|
|
51
|
+
/** `options` as core's `LiveValue.follow` takes them: an inertia's `timeConstant` in seconds. */
|
|
52
|
+
export const followOptionsOf = (options) => Bool.match(options.type === "inertia", {
|
|
53
|
+
onTrue: () => ({
|
|
54
|
+
...options,
|
|
55
|
+
...UndefinedOr.match(options.timeConstant, { onUndefined: () => ({}), onDefined: (ms) => ({ timeConstant: ms / 1000 }) }),
|
|
56
|
+
}),
|
|
57
|
+
onFalse: () => options,
|
|
58
|
+
});
|
|
59
|
+
/** The Atom of numbers each unit follow's Atom of strings shows ({@link withUnit}), for its `jump`. */
|
|
60
|
+
// Module state (#460, Q7): a cache held weakly by the object it's for, so it goes with it.
|
|
61
|
+
const UNIT_NUMBERS = new WeakMap();
|
|
62
|
+
/** A unit string's unit, as Motion's follower reads it (#441): what's left after its digits, `.` and `-`. */
|
|
63
|
+
export const unitOf = (value) => value.replace(/[\d.-]/g, "");
|
|
64
|
+
/**
|
|
65
|
+
* `numbers`, a follow of a unit string's numbers, shown with `unit` (#441, Motion's follower: the
|
|
66
|
+
* unit its source started with, whatever a later one says). Its `jump` reaches `numbers`.
|
|
67
|
+
*/
|
|
68
|
+
export const withUnit = (unit) => (numbers) => {
|
|
69
|
+
const strings = Atom.map(numbers, (n) => `${n}${unit}`);
|
|
70
|
+
UNIT_NUMBERS.set(strings, numbers);
|
|
71
|
+
return strings;
|
|
72
|
+
};
|
|
73
|
+
/** A value a follow reads: a number as it is, a string as `parseFloat` reads it, as Motion's follower does. */
|
|
74
|
+
export const numberOf = (value) => Bool.match(Predicate.isString(value), { onTrue: () => Number.parseFloat(value), onFalse: () => value });
|
|
75
|
+
/** `accessor`, carrying a follow's Atom, with `jump` run on `runtime`. */
|
|
76
|
+
export const followAccessorOf = (runtime, accessor) => {
|
|
77
|
+
const atom = atomOf(accessor);
|
|
78
|
+
// A follow's own Atom, by construction: the one kind `jump` takes (#618).
|
|
79
|
+
const numbers = UndefinedOr.match(UNIT_NUMBERS.get(atom), { onUndefined: () => atom, onDefined: (n) => n });
|
|
80
|
+
return Object.assign(accessor, {
|
|
81
|
+
jump: (value) => {
|
|
82
|
+
runtime.runSync(LiveValue.jump(numbers, numberOf(value)));
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
/** A server's follow: `read`, as it is now, and a `jump` that does nothing (ADR-0021). */
|
|
87
|
+
export const serverFollowOf = (read) => Object.assign(() => read(), { jump: constVoid });
|
|
88
|
+
/** The Atom a Live value is, or carries: `undefined` for a plain accessor or a plain value. Per key, per change: guards, no matcher. */
|
|
89
|
+
export const atomOf = (value) => {
|
|
90
|
+
if (Atom.isAtom(value))
|
|
91
|
+
return value;
|
|
92
|
+
if (Bool.not(Predicate.isFunction(value)))
|
|
93
|
+
return undefined;
|
|
94
|
+
return value[CARRIED];
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* `source` mapped through ranges by core (`LiveValue.transform`), for `createTransform` on an Atom: set
|
|
98
|
+
* where `source` is, and, when `source` derives from a scroll, described so an element runs it as a
|
|
99
|
+
* Timeline value (#240). Typed at `createTransform`'s overloads: numbers and strings through the
|
|
100
|
+
* registry, any type through a `mixer`.
|
|
101
|
+
*/
|
|
102
|
+
export const rangesOf = (source, input, output, options) => LiveValue.transform(source, input, output, options);
|
|
103
|
+
/** Whether `key` is a transform key, composed into `transform` (`x`, `scale`, `rotate`…). */
|
|
104
|
+
export const isTransformKey = (key) => Option.isSome(BaseValue.transformIdentity(key));
|
|
105
|
+
/** A style value, read now: an Atom (or the one an accessor carries) through `registry`, an accessor untracked, anything else as it is. */
|
|
106
|
+
export const readLive = (value, registry, untrack) => {
|
|
107
|
+
const atom = atomOf(value);
|
|
108
|
+
if (Predicate.isNotUndefined(atom))
|
|
109
|
+
return registry().get(atom);
|
|
110
|
+
if (Predicate.isFunction(value))
|
|
111
|
+
return untrack(value);
|
|
112
|
+
return value;
|
|
113
|
+
};
|
|
114
|
+
/** Whether a style's `key` is routed: its value is live, or it's a transform key with a value. */
|
|
115
|
+
const isRouted = (value, key) => Bool.and(Predicate.isNotNullish(value), Bool.or(isLive(value), isTransformKey(key)));
|
|
116
|
+
const NOTHING_ROUTED = {};
|
|
117
|
+
const NO_VALUES = {};
|
|
118
|
+
/** No style: nothing routed. */
|
|
119
|
+
const NO_STYLE = { css: undefined, routed: NOTHING_ROUTED, droppedTransform: false };
|
|
120
|
+
/** A user's style, split into its binding's part and the routed keys (its text form read by its Environment's `ownValues`). */
|
|
121
|
+
export const split = (user, ownValues) => {
|
|
122
|
+
if (Predicate.isUndefined(user))
|
|
123
|
+
return NO_STYLE;
|
|
124
|
+
const record = ownValues.recordOf(user);
|
|
125
|
+
const routed = Rec.filter(record, isRouted);
|
|
126
|
+
if (Rec.isEmptyRecord(routed))
|
|
127
|
+
return { css: user, routed: NOTHING_ROUTED, droppedTransform: false };
|
|
128
|
+
const droppedTransform = Bool.and(Arr.some(Rec.keys(routed), isTransformKey), Predicate.isNotNullish(record["transform"]));
|
|
129
|
+
// A `transform` string stays: the gate holds `transform` while a transform key is routed, so it's
|
|
130
|
+
// left out of what its binding writes, and shows again once none is.
|
|
131
|
+
const css = Rec.filter(record, (_, key) => Bool.not(Object.hasOwn(routed, key)));
|
|
132
|
+
return { css, routed, droppedTransform };
|
|
133
|
+
};
|
|
134
|
+
/** The routed keys' values, read now: the numbers and strings among them, as a values map. */
|
|
135
|
+
export const valuesOf = (routed, registry, untrack) => Bool.match(routed === NOTHING_ROUTED, {
|
|
136
|
+
onTrue: () => NO_VALUES,
|
|
137
|
+
onFalse: () => Stops.toValues(Rec.map(routed, (value) => readLive(value, registry, untrack))),
|
|
138
|
+
});
|
|
139
|
+
/**
|
|
140
|
+
* Watch `key`'s live source for `to`: an Atom, or the one an accessor carries, subscribed; any
|
|
141
|
+
* other accessor in a computation of its own.
|
|
142
|
+
*/
|
|
143
|
+
const watch = (self, key, source, to) => {
|
|
144
|
+
if (Bool.not(isLive(source)))
|
|
145
|
+
return;
|
|
146
|
+
if (Predicate.isUndefined(self.watching))
|
|
147
|
+
self.watching = new Map();
|
|
148
|
+
const atom = atomOf(source);
|
|
149
|
+
if (Predicate.isNotUndefined(atom)) {
|
|
150
|
+
self.watching.set(key, self.registry().subscribe(atom, (value) => to.change(key, value)));
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
self.watching.set(key, self.reactivity.watch(source, (value) => to.change(key, value)));
|
|
154
|
+
};
|
|
155
|
+
const unwatch = (self, key) => {
|
|
156
|
+
if (Predicate.isUndefined(self.watching))
|
|
157
|
+
return;
|
|
158
|
+
const stop = self.watching.get(key);
|
|
159
|
+
if (Predicate.isUndefined(stop))
|
|
160
|
+
return;
|
|
161
|
+
self.watching.delete(key);
|
|
162
|
+
stop();
|
|
163
|
+
};
|
|
164
|
+
/** Build the follower and watch every routed key. */
|
|
165
|
+
const start = (self, setup) => {
|
|
166
|
+
self.pending = undefined;
|
|
167
|
+
const to = setup();
|
|
168
|
+
self.follower = to;
|
|
169
|
+
Arr.forEach(Rec.keys(self.routed), (key) => watch(self, key, self.routed[key], to));
|
|
170
|
+
};
|
|
171
|
+
/** The routed keys now `next`: what left is removed, what's new or changed is watched and told. */
|
|
172
|
+
const reconcile = (self, next) => {
|
|
173
|
+
const prev = self.routed;
|
|
174
|
+
// Nothing routed, as before: the usual style.
|
|
175
|
+
if (next === prev)
|
|
176
|
+
return;
|
|
177
|
+
self.routed = next;
|
|
178
|
+
// The first routed key: the follower's setup writes them all.
|
|
179
|
+
if (Bool.and(Predicate.isNotUndefined(self.pending), Bool.not(Rec.isEmptyRecord(next)))) {
|
|
180
|
+
start(self, UndefinedOr.getOrThrow(self.pending));
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
const to = self.follower;
|
|
184
|
+
if (Predicate.isUndefined(to))
|
|
185
|
+
return;
|
|
186
|
+
Arr.forEach(Rec.keys(prev), (key) => {
|
|
187
|
+
if (Object.hasOwn(next, key))
|
|
188
|
+
return;
|
|
189
|
+
unwatch(self, key);
|
|
190
|
+
to.removed(key);
|
|
191
|
+
});
|
|
192
|
+
Arr.forEach(Rec.keys(next), (key) => {
|
|
193
|
+
const source = next[key];
|
|
194
|
+
if (Bool.and(Object.hasOwn(prev, key), prev[key] === source))
|
|
195
|
+
return;
|
|
196
|
+
unwatch(self, key);
|
|
197
|
+
watch(self, key, source, to);
|
|
198
|
+
to.change(key, readLive(source, self.registry, self.reactivity.untrack));
|
|
199
|
+
});
|
|
200
|
+
};
|
|
201
|
+
const Proto = {
|
|
202
|
+
started(legs) {
|
|
203
|
+
const turnOn = this.willChange();
|
|
204
|
+
if (Predicate.isUndefined(turnOn))
|
|
205
|
+
return;
|
|
206
|
+
if (Arr.some(legs, (leg) => Arr.some(Rec.keys(leg.to), turnsWillChangeOn)))
|
|
207
|
+
turnOn();
|
|
208
|
+
},
|
|
209
|
+
css(user) {
|
|
210
|
+
// The same style object as last time: the same answer (Solid may read `style` more than once).
|
|
211
|
+
if (Bool.and(user === this.seen, Predicate.isNotUndefined(this.seen)))
|
|
212
|
+
return this.last;
|
|
213
|
+
this.seen = user;
|
|
214
|
+
const parts = split(user, this.ownValues);
|
|
215
|
+
if (Bool.and(parts.droppedTransform, Bool.not(this.warned))) {
|
|
216
|
+
this.warned = true;
|
|
217
|
+
UndefinedOr.match(this.onDroppedTransform, { onUndefined: constVoid, onDefined: (warn) => warn() });
|
|
218
|
+
}
|
|
219
|
+
this.last = parts.css;
|
|
220
|
+
reconcile(this, parts.routed);
|
|
221
|
+
return this.last;
|
|
222
|
+
},
|
|
223
|
+
values() {
|
|
224
|
+
return valuesOf(this.routed, this.registry, this.reactivity.untrack);
|
|
225
|
+
},
|
|
226
|
+
routes(key) {
|
|
227
|
+
return Object.hasOwn(this.routed, key);
|
|
228
|
+
},
|
|
229
|
+
valueOf(key) {
|
|
230
|
+
return Option.map(Option.liftPredicate(this.routed, (routed) => Object.hasOwn(routed, key)), (routed) => readLive(routed[key], this.registry, this.reactivity.untrack));
|
|
231
|
+
},
|
|
232
|
+
isLive(key) {
|
|
233
|
+
return Bool.and(Object.hasOwn(this.routed, key), isLive(this.routed[key]));
|
|
234
|
+
},
|
|
235
|
+
atomOf(key) {
|
|
236
|
+
return atomOf(this.routed[key]);
|
|
237
|
+
},
|
|
238
|
+
willChange() {
|
|
239
|
+
const routed = this.routed;
|
|
240
|
+
if (routed === NOTHING_ROUTED)
|
|
241
|
+
return undefined;
|
|
242
|
+
if (Object.hasOwn(routed, "willChange"))
|
|
243
|
+
return turnOnOf(routed["willChange"]);
|
|
244
|
+
if (Object.hasOwn(routed, "will-change"))
|
|
245
|
+
return turnOnOf(routed["will-change"]);
|
|
246
|
+
return undefined;
|
|
247
|
+
},
|
|
248
|
+
read(value) {
|
|
249
|
+
return readLive(value, this.registry, this.reactivity.untrack);
|
|
250
|
+
},
|
|
251
|
+
whenRouted(setup) {
|
|
252
|
+
if (Rec.isEmptyRecord(this.routed)) {
|
|
253
|
+
this.pending = setup;
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
start(this, setup);
|
|
257
|
+
},
|
|
258
|
+
stop() {
|
|
259
|
+
this.follower = undefined;
|
|
260
|
+
this.pending = undefined;
|
|
261
|
+
const watching = this.watching;
|
|
262
|
+
if (Predicate.isUndefined(watching))
|
|
263
|
+
return;
|
|
264
|
+
Arr.forEach(Arr.fromIterable(watching.keys()), (key) => unwatch(this, key));
|
|
265
|
+
},
|
|
266
|
+
};
|
|
267
|
+
/**
|
|
268
|
+
* An element's {@link LiveStyle}: one object, its methods shared, so an element that routes nothing
|
|
269
|
+
* pays for little more than it. Creates computations for accessors while it follows; their roots
|
|
270
|
+
* are its own. Call its methods on it (`live.read(v)`), not detached.
|
|
271
|
+
*/
|
|
272
|
+
export const createLiveStyle = (options) => {
|
|
273
|
+
const state = {
|
|
274
|
+
registry: options.registry,
|
|
275
|
+
onDroppedTransform: options.onDroppedTransform,
|
|
276
|
+
reactivity: options.reactivity,
|
|
277
|
+
ownValues: options.ownValues,
|
|
278
|
+
routed: NOTHING_ROUTED,
|
|
279
|
+
seen: undefined,
|
|
280
|
+
last: undefined,
|
|
281
|
+
warned: false,
|
|
282
|
+
follower: undefined,
|
|
283
|
+
pending: undefined,
|
|
284
|
+
watching: undefined,
|
|
285
|
+
};
|
|
286
|
+
return Object.assign(Object.create(Proto), state);
|
|
287
|
+
};
|
|
288
|
+
/** Each `createWillChange` value's turn-on (#443), by its accessor and by the Atom it carries. */
|
|
289
|
+
// Module state (#460, Q7): a cache held weakly by the object it's for, so it goes with it.
|
|
290
|
+
const WILL_CHANGE = new WeakMap();
|
|
291
|
+
/**
|
|
292
|
+
* A `createWillChange` value (#443): its Atom, `"auto"`, held in `registry` until `onCleanup` runs,
|
|
293
|
+
* as an accessor `wrap` makes. Its turn-on sets it to `"transform"`, once, for good, as Motion's
|
|
294
|
+
* `WillChangeMotionValue` stays enabled. The accessor and its Atom are both marked, so a `style` that
|
|
295
|
+
* routes either finds it.
|
|
296
|
+
*/
|
|
297
|
+
export const willChangeOf = (registry, onCleanup, wrap) => {
|
|
298
|
+
const atom = Atom.make("auto");
|
|
299
|
+
onCleanup(registry.mount(atom));
|
|
300
|
+
let on = false;
|
|
301
|
+
const turnOn = () => {
|
|
302
|
+
if (on)
|
|
303
|
+
return;
|
|
304
|
+
on = true;
|
|
305
|
+
registry.set(atom, "transform");
|
|
306
|
+
};
|
|
307
|
+
const accessor = wrap(atom);
|
|
308
|
+
WILL_CHANGE.set(atom, turnOn);
|
|
309
|
+
WILL_CHANGE.set(accessor, turnOn);
|
|
310
|
+
return accessor;
|
|
311
|
+
};
|
|
312
|
+
/** A style value's will-change turn-on (#443), when it's a `createWillChange` value; `undefined` for anything else. */
|
|
313
|
+
const turnOnOf = (value) => WILL_CHANGE.get(value);
|
|
314
|
+
/**
|
|
315
|
+
* The keys whose animation turns a will-change value on (#443, Motion's `addValueToWillChange`): the
|
|
316
|
+
* transform keys, and the ones a browser can animate on its compositor (Motion's `acceleratedValues`).
|
|
317
|
+
*/
|
|
318
|
+
const ACCELERATED = new Set(["transform", "opacity", "clipPath", "clip-path", "filter", "backgroundColor", "background-color"]);
|
|
319
|
+
/** Whether animating `key` turns a will-change value on (#443). */
|
|
320
|
+
export const turnsWillChangeOn = (key) => Bool.or(isTransformKey(key), ACCELERATED.has(key));
|
|
321
|
+
/** A server's registry, made on first need: an Atom read there gives the Atom's first value (ADR-0021). */
|
|
322
|
+
// Module state (#460, Q7): built once, on a server, where no provider's runtime runs.
|
|
323
|
+
let serverRegistry;
|
|
324
|
+
export const serverRegistryOf = () => {
|
|
325
|
+
if (Predicate.isUndefined(serverRegistry))
|
|
326
|
+
serverRegistry = AtomRegistry.make();
|
|
327
|
+
return serverRegistry;
|
|
328
|
+
};
|
|
329
|
+
//# sourceMappingURL=L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