kuinetic 0.2.4 → 0.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/README.md +2 -2
- package/dist/esm/advanced/index.mjs +1 -1
- package/dist/esm/{chunk-FASAEQDR.mjs → chunk-CG37RODK.mjs} +1232 -277
- package/dist/esm/{chunk-AEQGC2KM.mjs → chunk-EDFJTT5B.mjs} +2 -1
- package/dist/esm/{chunk-MZQG2VMG.mjs → chunk-W7U4A2NK.mjs} +708 -610
- package/dist/esm/{chunk-EHS45PIK.mjs → chunk-Y2FP56K5.mjs} +9228 -4275
- package/dist/esm/core/index.mjs +3 -3
- package/dist/esm/effects/index.mjs +3 -3
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/notes/index.mjs +347 -9
- package/dist/kuinetic.advanced.js +2 -1
- package/dist/kuinetic.advanced.min.js +1 -1
- package/dist/kuinetic.all.js +9099 -3152
- package/dist/kuinetic.all.min.js +4 -2
- package/dist/kuinetic.css +2408 -161
- package/dist/kuinetic.js +9098 -3151
- package/dist/kuinetic.min.css +1 -1
- package/dist/kuinetic.min.js +3 -1
- package/dist/kuinetic.notes.js +1 -1
- package/dist/types/advanced/shaders.d.ts +1 -1
- package/dist/types/core/animator.d.ts +61 -2
- package/dist/types/core/attrs.d.ts +0 -2
- package/dist/types/core/auto-motion.d.ts +139 -0
- package/dist/types/core/cadence.d.ts +90 -0
- package/dist/types/core/channels.d.ts +5 -1
- package/dist/types/core/compile.d.ts +14 -2
- package/dist/types/core/deck-viewer.d.ts +2 -0
- package/dist/types/core/declarations.d.ts +6 -0
- package/dist/types/core/derived/group-gate.d.ts +18 -4
- package/dist/types/core/describe.d.ts +1 -1
- package/dist/types/core/easing.d.ts +9 -0
- package/dist/types/core/effect-context.d.ts +5 -0
- package/dist/types/core/element-config.d.ts +5 -4
- package/dist/types/core/flip.d.ts +25 -1
- package/dist/types/core/gesture.d.ts +5 -0
- package/dist/types/core/image-flight.d.ts +23 -0
- package/dist/types/core/instances.d.ts +27 -3
- package/dist/types/core/js-effect-preparer.d.ts +3 -1
- package/dist/types/core/owned-styles.d.ts +2 -1
- package/dist/types/core/params.d.ts +2 -3
- package/dist/types/core/parse.d.ts +21 -1
- package/dist/types/core/pause-scope.d.ts +40 -0
- package/dist/types/core/play.d.ts +2 -2
- package/dist/types/core/registry.d.ts +17 -2
- package/dist/types/core/repeat.d.ts +6 -4
- package/dist/types/core/sequence.d.ts +10 -0
- package/dist/types/core/stagger-config.d.ts +23 -101
- package/dist/types/core/stagger-keys.d.ts +2 -4
- package/dist/types/core/stagger.d.ts +12 -21
- package/dist/types/core/types.d.ts +76 -19
- package/dist/types/effects/auto-motion.d.ts +22 -117
- package/dist/types/effects/carousel/archive.d.ts +18 -0
- package/dist/types/effects/carousel/coast.d.ts +7 -0
- package/dist/types/effects/carousel/deck.d.ts +31 -2
- package/dist/types/effects/carousel/drag.d.ts +24 -7
- package/dist/types/effects/carousel/glide.d.ts +89 -0
- package/dist/types/effects/carousel/line.d.ts +10 -0
- package/dist/types/effects/carousel/row-copies.d.ts +13 -0
- package/dist/types/effects/carousel/row.d.ts +3 -0
- package/dist/types/effects/carousel/shape-fit.d.ts +54 -0
- package/dist/types/effects/carousel/sources.d.ts +26 -0
- package/dist/types/effects/carousel/sphere.d.ts +23 -0
- package/dist/types/effects/carousel/stack.d.ts +2 -1
- package/dist/types/effects/catalog/confetti.d.ts +2 -0
- package/dist/types/effects/catalog/cursor-trail.d.ts +2 -0
- package/dist/types/effects/catalog/curtains.d.ts +2 -0
- package/dist/types/effects/catalog/feedback.d.ts +1 -1
- package/dist/types/effects/catalog/image-flight.d.ts +2 -0
- package/dist/types/effects/catalog/line-boil.d.ts +2 -0
- package/dist/types/effects/catalog/media-shared.d.ts +10 -0
- package/dist/types/effects/catalog/number-tokens.d.ts +5 -0
- package/dist/types/effects/catalog/numbers-shared.d.ts +3 -4
- package/dist/types/effects/catalog/pause-scope.d.ts +20 -0
- package/dist/types/effects/catalog/text-shared.d.ts +17 -6
- package/dist/types/effects/catalog/typewriter-scatter.d.ts +5 -0
- package/dist/types/effects/catalog/view-transitions.d.ts +32 -1
- package/dist/types/effects/catalog/wobble.d.ts +2 -0
- package/dist/types/effects/gestures/drag-options.d.ts +17 -0
- package/dist/types/effects/layout/departures.d.ts +21 -0
- package/dist/types/effects/motion-path/fit.d.ts +4 -0
- package/dist/types/effects/scroll-mechanics/progress-output.d.ts +9 -0
- package/dist/types/effects/scroll-mechanics/snap-autoplay.d.ts +20 -0
- package/dist/types/effects/step-index.d.ts +19 -1
- package/dist/types/effects/step-marking.d.ts +7 -4
- package/dist/types/effects/svg/morph-loop.d.ts +7 -0
- package/dist/types/effects/svg/text-path.d.ts +2 -0
- package/dist/types/effects/three-d/cube.d.ts +2 -0
- package/dist/types/effects/tween/index.d.ts +2 -1
- package/dist/types/effects/tween/properties.d.ts +1 -1
- package/dist/types/effects/tween/toggle.d.ts +6 -0
- package/dist/types/effects/tween/waypoints.d.ts +1 -1
- package/dist/types/notes/effects.d.ts +1 -0
- package/dist/types/notes/index.d.ts +11 -0
- package/dist/types/notes/showcase.d.ts +1 -0
- package/dist/types/showcase/lightbox-flight.d.ts +11 -0
- package/dist/types/showcase/media-source.d.ts +1 -0
- package/dist/types/showcase/modal-shell.d.ts +5 -0
- package/dist/types/showcase/youtube.d.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { CompiledDocument } from './compile.js';
|
|
2
|
+
import type { PrepareContext } from './effect-context.js';
|
|
3
|
+
import type { Cleanup } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* The runtime half of `every:` — "while this element is on screen, the tab is visible, nothing
|
|
6
|
+
* pauses it and the visitor has not asked for reduced motion, perform one demonstration step every
|
|
7
|
+
* period" — as a thin layer over the library's one scheduler.
|
|
8
|
+
*
|
|
9
|
+
* It is `createAutoMotion` configured as a pure timer (`autoplayMs`, no spin, no settle), so the pause
|
|
10
|
+
* rules are not restated here: offscreen, hidden tab, keyboard focus, a paused scope and reduced
|
|
11
|
+
* motion all come from the scheduler, which a deck's `autoplay:` and a scroll-snap strip's share. A
|
|
12
|
+
* private `setInterval` would have been the third copy of those rules (decks, `slideshow`, this).
|
|
13
|
+
*
|
|
14
|
+
* Two deliberate departures from a deck's defaults:
|
|
15
|
+
*
|
|
16
|
+
* - **Hover does not pause it.** A demo loop is not text to read, and a pointer resting on a tile
|
|
17
|
+
* would otherwise freeze exactly the tile the visitor is looking at. Keyboard focus still pauses,
|
|
18
|
+
* and WCAG 2.2.2's "a way to pause" is served by the `pause-scope` control.
|
|
19
|
+
* - **Reduced motion never arms it.** The scheduler starts paused under that preference and a cadence
|
|
20
|
+
* has no play control to lift it, which is the point: no demo loop for a visitor who asked for none.
|
|
21
|
+
*
|
|
22
|
+
* What a *step* is lives in the animator (`Animator#cadenceTick`) because it needs the element's
|
|
23
|
+
* lifecycle state; this module only decides *when*.
|
|
24
|
+
*/
|
|
25
|
+
/** What {@link createCadence} needs. */
|
|
26
|
+
export interface CadenceRequest {
|
|
27
|
+
el: Element;
|
|
28
|
+
/** The authored period in milliseconds; floored to the scheduler's 2s minimum with a warning. */
|
|
29
|
+
periodMs: number;
|
|
30
|
+
/** The realm, document and reduced-motion preference the scheduler reads. */
|
|
31
|
+
host: Pick<PrepareContext, 'win' | 'doc' | 'reducedMotion'>;
|
|
32
|
+
/** Perform one demonstration step. Called only while nothing pauses the cadence. */
|
|
33
|
+
tick(): void;
|
|
34
|
+
warn(message: string): void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Start a cadence on one element.
|
|
38
|
+
*
|
|
39
|
+
* A period of `0` (or one that is not finite) arms nothing and says why, rather than looping at the
|
|
40
|
+
* floor: `every:0s` is more likely a typo than a request for the fastest loop allowed.
|
|
41
|
+
*
|
|
42
|
+
* @returns Its release; always safe to call, including twice.
|
|
43
|
+
* @complexity O(1) time and space.
|
|
44
|
+
* @overallScore 100
|
|
45
|
+
*/
|
|
46
|
+
export declare function createCadence(request: CadenceRequest): {
|
|
47
|
+
release: Cleanup;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Read an `every:` value into milliseconds.
|
|
51
|
+
*
|
|
52
|
+
* `parse.ts` validates the token as a non-negative `s`/`ms` time.
|
|
53
|
+
* {@link createCadence} rejects periods that overflow when converted to milliseconds.
|
|
54
|
+
*
|
|
55
|
+
* @complexity O(n) time in the token length; O(1) space.
|
|
56
|
+
* @overallScore 100
|
|
57
|
+
*/
|
|
58
|
+
export declare function everyToMs(every: string): number;
|
|
59
|
+
/**
|
|
60
|
+
* The cycle hooks of the host group's composed primitives, as thunks that run them.
|
|
61
|
+
*
|
|
62
|
+
* A thunk reads its params exactly as `js-effect-preparer.ts` does for the same entry (preset
|
|
63
|
+
* defaults under the authored values, validated against the entry's own schema), so a hook sees the
|
|
64
|
+
* values the effect itself runs with — `auto-height`'s `attribute:` is the author's, not a default.
|
|
65
|
+
* Each thunk is isolated: a hook that throws is warned about and the next one still runs, mirroring
|
|
66
|
+
* `startInstance`, so one bad hook cannot stop the cadence.
|
|
67
|
+
*
|
|
68
|
+
* Only the host group's entries count. A `target:` group's entries act on derived matches, and a
|
|
69
|
+
* cycle hook is handed the host element; calling it for a group would mutate the wrong node. When a
|
|
70
|
+
* group names a primitive that has a hook, the animator says so once ({@link hasGroupedCycle}) and
|
|
71
|
+
* the group replays instead.
|
|
72
|
+
*
|
|
73
|
+
* @param el - The element the cadence is on (the host).
|
|
74
|
+
* @param document - The element's compiled document; an empty selector identifies its host group.
|
|
75
|
+
* @param warn - The element's warning sink.
|
|
76
|
+
* @returns One thunk per host-group entry whose primitive declares `cycle`; empty when none do.
|
|
77
|
+
* @complexity O(e) time and space in composed effects.
|
|
78
|
+
* @overallScore 100
|
|
79
|
+
*/
|
|
80
|
+
export declare function cycleThunks(el: Element, document: CompiledDocument, warn: (message: string) => void): Array<() => void>;
|
|
81
|
+
/**
|
|
82
|
+
* Whether a `target:` group (not the host's own) composes a primitive with a cycle hook.
|
|
83
|
+
*
|
|
84
|
+
* Separate from {@link cycleThunks} so the animator can say it once, when a cadence is created,
|
|
85
|
+
* instead of on every replay's recompile.
|
|
86
|
+
*
|
|
87
|
+
* @complexity O(e) time in composed effects; O(1) space.
|
|
88
|
+
* @overallScore 100
|
|
89
|
+
*/
|
|
90
|
+
export declare function hasGroupedCycle(document: CompiledDocument): boolean;
|
|
@@ -54,6 +54,8 @@ export interface ChannelClaim {
|
|
|
54
54
|
* knowledge, not this module's.
|
|
55
55
|
*/
|
|
56
56
|
inlineAnimation?: boolean;
|
|
57
|
+
/** Prior CSS claims whose active interval ends before this claim starts. */
|
|
58
|
+
follows?: Set<ChannelClaim>;
|
|
57
59
|
}
|
|
58
60
|
export interface Conflict {
|
|
59
61
|
channel: Channel;
|
|
@@ -78,6 +80,8 @@ export interface Conflict {
|
|
|
78
80
|
export declare const CHANNEL_COMPOSITION: Partial<Record<Channel, 'add'>>;
|
|
79
81
|
/** Whether every channel a claim writes can survive being made additive. */
|
|
80
82
|
export declare function additiveChannels(channels: readonly Channel[]): boolean;
|
|
83
|
+
/** Whether two claims really contest one of the channels being rescued. */
|
|
84
|
+
export declare function claimsOverlap(a: ChannelClaim, b: ChannelClaim): boolean;
|
|
81
85
|
/**
|
|
82
86
|
* Rescue a surviving clash by summing the claims that caused it instead of letting one replace the
|
|
83
87
|
* other.
|
|
@@ -91,7 +95,7 @@ export declare function additiveChannels(channels: readonly Channel[]): boolean;
|
|
|
91
95
|
*
|
|
92
96
|
* @returns Indices of the claims to compile additively, or `undefined` when the rescue does not
|
|
93
97
|
* apply and the caller should refuse the list.
|
|
94
|
-
* @complexity O(n * c) time in claims and their channels; O(n + c) space.
|
|
98
|
+
* @complexity O(n^2 * c^2) time in claims and their channels; O(n + c) space.
|
|
95
99
|
* @overallScore 100
|
|
96
100
|
*/
|
|
97
101
|
export declare function additiveResolution(claims: ChannelClaim[], conflicts: Conflict[]): Set<number> | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AnimationTracks } from './declarations.js';
|
|
1
2
|
import type { ActivationSupportClaim } from './activation.js';
|
|
2
3
|
import type { Registry, ResolvedEffect } from './registry.js';
|
|
3
4
|
import type { SequenceStep } from './sequence.js';
|
|
@@ -6,6 +7,7 @@ import type { Activation, Channel, EffectSpec, EffectVariant, NamedActivation, P
|
|
|
6
7
|
export interface Entry {
|
|
7
8
|
spec: EffectSpec;
|
|
8
9
|
resolved: ResolvedEffect;
|
|
10
|
+
tileFit?: 'stretch';
|
|
9
11
|
/**
|
|
10
12
|
* Per-spec refinement from `primitive.variantFor`, computed once in `resolveEntries` and carried
|
|
11
13
|
* on the entry so nothing downstream has to call it a second time. Absent for every primitive
|
|
@@ -44,6 +46,7 @@ export interface Entry {
|
|
|
44
46
|
target?: string;
|
|
45
47
|
/** Which tree {@link target} is searched in. Only meaningful when `target` is set. */
|
|
46
48
|
scope?: TargetScope;
|
|
49
|
+
mountTargets?: CompiledTarget['mountTargets'];
|
|
47
50
|
/**
|
|
48
51
|
* `animation-composition` for every track this entry compiles, when the composition resolver had
|
|
49
52
|
* to make it additive to let a same-channel neighbour survive — see {@link resolveComposition}.
|
|
@@ -54,6 +57,9 @@ export interface Entry {
|
|
|
54
57
|
* omits an all-`normal` `animation-direction`.
|
|
55
58
|
*/
|
|
56
59
|
composite?: 'add';
|
|
60
|
+
stagger?: string;
|
|
61
|
+
handoff?: ReadonlySet<Channel>;
|
|
62
|
+
handoffEnd?: boolean;
|
|
57
63
|
}
|
|
58
64
|
/**
|
|
59
65
|
* Channels one entry actually writes — the primitive's declaration, widened by any variant.
|
|
@@ -106,6 +112,7 @@ export interface CompiledPlan {
|
|
|
106
112
|
* `finished` while the animation was still visibly running.
|
|
107
113
|
*/
|
|
108
114
|
keyframeNames: string[];
|
|
115
|
+
repeatDelays?: AnimationTracks['repeatDelays'];
|
|
109
116
|
/** Effects whose renderer needs JS setup. */
|
|
110
117
|
jsEffects: Entry[];
|
|
111
118
|
/** Names that are not registered. Must NOT be stamped, or the element is never rescanned. */
|
|
@@ -170,9 +177,13 @@ export declare function compile(parsed: ParsedValue, registry: Registry, timelin
|
|
|
170
177
|
* itself — see `Entry.target`'s own comment for which primitives those are.
|
|
171
178
|
*/
|
|
172
179
|
export interface CompiledTarget {
|
|
173
|
-
/** `''` for the host
|
|
180
|
+
/** `''` for the host and split groups. */
|
|
174
181
|
selector: string;
|
|
175
182
|
scope: TargetScope;
|
|
183
|
+
split?: EffectSpec['split'];
|
|
184
|
+
rows?: EffectSpec['rows'];
|
|
185
|
+
tileFit?: Entry['tileFit'];
|
|
186
|
+
mountTargets?(host: Element, warn: (message: string) => void): Element[];
|
|
176
187
|
/**
|
|
177
188
|
* Segment-scoped hoists merged across this group's own member entries, or absent when none of
|
|
178
189
|
* them carried one — see `SegmentHoists` and `scopeHoists`. Not yet consumed at runtime (that is
|
|
@@ -230,10 +241,11 @@ export interface CompiledDocument {
|
|
|
230
241
|
* @param parsed - Output of `parse`.
|
|
231
242
|
* @param registry - Effect catalog to resolve names against.
|
|
232
243
|
* @param timeline - Element-scoped timeline, used to warn on unsupported combinations.
|
|
244
|
+
* @param repeatDelaySupport - Runtime timing support, or 'reduced' to omit holds for reduced motion.
|
|
233
245
|
* @complexity O(e * p) time in composed effects and their parameters; O(e) space.
|
|
234
246
|
* @overallScore 100
|
|
235
247
|
*/
|
|
236
|
-
export declare function compileTargets(parsed: ParsedValue, registry: Registry, timeline: Timeline): CompiledDocument;
|
|
248
|
+
export declare function compileTargets(parsed: ParsedValue, registry: Registry, timeline: Timeline, repeatDelaySupport?: boolean | 'reduced'): CompiledDocument;
|
|
237
249
|
/**
|
|
238
250
|
* Fold a targeted segment's provisional hoists (`spec.hoists`, from `parse.ts`) back onto the
|
|
239
251
|
* element-wide `ParsedValue` for any spec whose primitive is not itself a `target:`-declaring one
|
|
@@ -28,6 +28,8 @@ export interface DeckViewerRequest {
|
|
|
28
28
|
host: Element;
|
|
29
29
|
/** The deck's cards in order, read at each click so a card added later is included. */
|
|
30
30
|
cards: () => Iterable<Element>;
|
|
31
|
+
/** The original corresponding to the current position, when positions repeat. */
|
|
32
|
+
activeCard?: () => Element | undefined;
|
|
31
33
|
doc: Document;
|
|
32
34
|
reducedMotion: boolean;
|
|
33
35
|
}
|
|
@@ -38,8 +38,12 @@ export interface AnimationTracks {
|
|
|
38
38
|
* concatenation and knowing the timeline here would buy nothing else.
|
|
39
39
|
*/
|
|
40
40
|
ends: string[];
|
|
41
|
+
staggerSpans: string[];
|
|
41
42
|
easings: string[];
|
|
42
43
|
iterationCounts: string[];
|
|
44
|
+
fillModes: string[];
|
|
45
|
+
/** Gap in milliseconds, indexed by the corresponding position in animation-name. */
|
|
46
|
+
repeatDelays?: Map<number, number>;
|
|
43
47
|
/**
|
|
44
48
|
* One `animation-direction` per track. Almost always every entry is `normal`, which is the CSS
|
|
45
49
|
* initial value — see {@link declarationsFor} for why that case emits no declaration at all.
|
|
@@ -126,3 +130,5 @@ export declare function pushTransitions(segments: string[], owners: Map<string,
|
|
|
126
130
|
* @overallScore 100
|
|
127
131
|
*/
|
|
128
132
|
export declare function declarationsFor(tracks: AnimationTracks, timeline: Timeline): Record<string, string>;
|
|
133
|
+
/** Ordinary DOM members can pick up a nested offset even if their group is staged later. */
|
|
134
|
+
export declare function withNestedStagger(delay: string): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnimatorPort, DerivedInstallContext } from './types.js';
|
|
1
|
+
import type { AnimatorPort, DerivedInstallContext, LiveTargetGroup } from './types.js';
|
|
2
2
|
import type { CompiledTarget } from '../compile.js';
|
|
3
3
|
import type { InstanceState } from '../types.js';
|
|
4
4
|
/**
|
|
@@ -9,9 +9,8 @@ import type { InstanceState } from '../types.js';
|
|
|
9
9
|
* match does.
|
|
10
10
|
*/
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* an ordinary derived install would.
|
|
12
|
+
* Split groups and groups with effective stagger keys bind on the authored host. Other selector
|
|
13
|
+
* groups let each member bind its own gate as an ordinary derived install would.
|
|
15
14
|
*
|
|
16
15
|
* The effective keys follow the same "each key decided on its own" rule the rest of `target:`
|
|
17
16
|
* uses: the group's own scoped hoists (`target.hoists`) override the host's element-wide keys
|
|
@@ -42,6 +41,21 @@ export declare function groupGateOwner(port: AnimatorPort, context: DerivedInsta
|
|
|
42
41
|
* @overallScore 100
|
|
43
42
|
*/
|
|
44
43
|
export declare function skipsOwnBinding(state: InstanceState): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Bind one grouped `target:` group's activation on `host`, when its style plan actually needs a
|
|
46
|
+
* binding at all (`gate === 'deferred'` — the same check `Animator.openGate` makes per element: a
|
|
47
|
+
* group that renders natively or immediately has nothing to gate). Registers the release with
|
|
48
|
+
* {@link registerCleanup} so the binding is torn down when the host is released. Passes no
|
|
49
|
+
* `cross` — a v1 limitation: a grouped target's `actions:` four-way crossings are not wired up,
|
|
50
|
+
* only the two-way activate/deactivate.
|
|
51
|
+
*
|
|
52
|
+
* @param port - The animator's narrow window.
|
|
53
|
+
* @param host - The group's gate owner.
|
|
54
|
+
* @param group - The live group to (maybe) bind.
|
|
55
|
+
* @complexity O(1) time and space — the fan-out lives in the closures this installs, not here.
|
|
56
|
+
* @overallScore 100
|
|
57
|
+
*/
|
|
58
|
+
export declare function bindOneGroup(port: AnimatorPort, host: Element, group: LiveTargetGroup): void;
|
|
45
59
|
/**
|
|
46
60
|
* Install one activation binding on `host` per grouped live `target:` group, activating (and, for
|
|
47
61
|
* a paired exit, deactivating) every member in document order through `port.activateOne`/
|
|
@@ -48,7 +48,7 @@ export interface ParamDescription {
|
|
|
48
48
|
* which has no grammar — any value that passes the escape screen, quoted if it has spaces.
|
|
49
49
|
*/
|
|
50
50
|
spellings: string[];
|
|
51
|
-
/** The closed word list
|
|
51
|
+
/** The closed word list for a keyword or keyword union. */
|
|
52
52
|
keywords?: readonly string[];
|
|
53
53
|
minimum?: number;
|
|
54
54
|
maximum?: number;
|
|
@@ -39,6 +39,15 @@ export declare function cssEasingValue(easing: string): string;
|
|
|
39
39
|
* @overallScore 100
|
|
40
40
|
*/
|
|
41
41
|
export declare function waapiEasingValue(easing: string, el: Element, warn: (message: string) => void): string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Read `--kui-ease-<name>` as the cascade would see it on this element.
|
|
44
|
+
*
|
|
45
|
+
* @returns The literal value, or `''` when nothing defines the property — which is also what an
|
|
46
|
+
* element in a document with no view returns, and both mean the same thing to the caller.
|
|
47
|
+
* @complexity O(1) time and space, but forces a style recalculation.
|
|
48
|
+
* @overallScore 100
|
|
49
|
+
*/
|
|
50
|
+
export declare function customEasing(name: string, el: Element): string;
|
|
42
51
|
/**
|
|
43
52
|
* Everything wrong with a `spring(...)` token, named one problem at a time.
|
|
44
53
|
*
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Capabilities } from './capabilities.js';
|
|
2
2
|
import type { StyleLedger } from './owned-styles.js';
|
|
3
3
|
import type { ScrollRoot, ScrollScheduler } from './scroll-scheduler.js';
|
|
4
|
+
import type { Timeline } from './types.js';
|
|
4
5
|
/**
|
|
5
6
|
* What a JS-rendered primitive receives.
|
|
6
7
|
*
|
|
@@ -14,6 +15,8 @@ import type { ScrollRoot, ScrollScheduler } from './scroll-scheduler.js';
|
|
|
14
15
|
* string.
|
|
15
16
|
*/
|
|
16
17
|
export interface PrepareContext {
|
|
18
|
+
/** Resolved element-wide timeline; omitted by older embedding contexts means time. */
|
|
19
|
+
timeline?: Timeline;
|
|
17
20
|
doc: Document;
|
|
18
21
|
win: Window;
|
|
19
22
|
/** Shared frame source. One listener per scroll root, one rAF per dirtied frame. */
|
|
@@ -38,6 +41,8 @@ export interface PrepareContext {
|
|
|
38
41
|
reducedMotion: boolean;
|
|
39
42
|
/** Aborted on teardown, so a primitive can pass it straight to `addEventListener`. */
|
|
40
43
|
signal: AbortSignal;
|
|
44
|
+
/** Cancel this host through its animator, suppressing completion when geometry invalidates it. */
|
|
45
|
+
cancel?(): void;
|
|
41
46
|
/**
|
|
42
47
|
* Ledger for this element's inline style.
|
|
43
48
|
*
|
|
@@ -4,14 +4,13 @@ import type { Activation, ParsedValue, SegmentHoists, Timeline } from './types.j
|
|
|
4
4
|
export interface ElementAttributes {
|
|
5
5
|
source: string;
|
|
6
6
|
on: string | null;
|
|
7
|
-
timeline: string | null;
|
|
8
7
|
threshold: string | null;
|
|
9
8
|
}
|
|
10
9
|
export interface ElementConfig {
|
|
11
10
|
activation: Activation;
|
|
12
11
|
/** Whether the author named an activation, so a primitive default may fill in when not. */
|
|
13
12
|
activationAuthored: boolean;
|
|
14
|
-
/** Optional
|
|
13
|
+
/** Optional event source selector from inline `via:` or longhand `from:`. */
|
|
15
14
|
activationSource?: string;
|
|
16
15
|
/**
|
|
17
16
|
* What to do at each of the observer's four crossings, when the author wrote `actions:`.
|
|
@@ -22,7 +21,9 @@ export interface ElementConfig {
|
|
|
22
21
|
*/
|
|
23
22
|
actions?: ToggleActions;
|
|
24
23
|
timeline: Timeline;
|
|
25
|
-
|
|
24
|
+
timelineAxis?: string;
|
|
25
|
+
timelineName?: string;
|
|
26
|
+
/** Explicit `range:` or trailing tokens of a quoted `timeline:`. */
|
|
26
27
|
range: string;
|
|
27
28
|
threshold: string;
|
|
28
29
|
}
|
|
@@ -48,7 +49,7 @@ export declare function readAttributes(el: Element): ElementAttributes;
|
|
|
48
49
|
* @param attributes - Snapshot from `readAttributes`.
|
|
49
50
|
* @param parsed - Result of parsing the `data-kui` value, whose hoisted keys win.
|
|
50
51
|
* @returns Fully defaulted configuration; unknown values fall back rather than throwing.
|
|
51
|
-
* @complexity O(k) time in the length of the timeline
|
|
52
|
+
* @complexity O(k) time in the length of the timeline value; O(1) extra space.
|
|
52
53
|
* @overallScore 100
|
|
53
54
|
*/
|
|
54
55
|
export declare function resolveConfig(attributes: ElementAttributes, parsed: ParsedValue): ElementConfig;
|
|
@@ -35,6 +35,18 @@ export interface FlipOptions {
|
|
|
35
35
|
easing?: string;
|
|
36
36
|
/** Animate width/height differences as a scale. Off for elements with visible borders. */
|
|
37
37
|
scale?: boolean;
|
|
38
|
+
/** Include the container and descendants, correcting inherited transforms. Opt-in only. */
|
|
39
|
+
nested?: boolean;
|
|
40
|
+
/** A state watcher needs to cache destination geometry before animation writes. */
|
|
41
|
+
attribute?: string;
|
|
42
|
+
/** Refresh the cached layout when it changes with no watched mutation. */
|
|
43
|
+
watchRest?: (refresh: () => void) => Cleanup;
|
|
44
|
+
/** Convert cached boxes and update the measurement batch when its scroll chain changes. */
|
|
45
|
+
rebase?: (before: FlipSnapshot) => FlipSnapshot;
|
|
46
|
+
/** Opt-in departure hooks; ordinary FLIP never reads animated styles. */
|
|
47
|
+
interrupt?: (before: FlipSnapshot) => FlipSnapshot;
|
|
48
|
+
prepareChange?: () => void;
|
|
49
|
+
exclude?: (el: Element) => boolean;
|
|
38
50
|
}
|
|
39
51
|
export interface FlipRun {
|
|
40
52
|
/** Elements that actually moved. Unmoved elements are skipped, not animated to identity. */
|
|
@@ -58,6 +70,17 @@ export interface FlipEngine {
|
|
|
58
70
|
* @overallScore 100
|
|
59
71
|
*/
|
|
60
72
|
export declare function domMeasure(el: Element): Box;
|
|
73
|
+
/**
|
|
74
|
+
* Measure inside a frame rather than the viewport.
|
|
75
|
+
*
|
|
76
|
+
* A mutation observer sees only the end state, so "first" is a box cached before the change, and it
|
|
77
|
+
* can be very old. Viewport boxes go stale on every scroll. Boxes in the frame's scrolled-content
|
|
78
|
+
* coordinates do not. `null` keeps viewport boxes, for a host that scrolling does not move.
|
|
79
|
+
*
|
|
80
|
+
* @complexity O(1) time per element; reads geometry and scroll offsets.
|
|
81
|
+
* @overallScore 100
|
|
82
|
+
*/
|
|
83
|
+
export declare function measureWithin(frame: Element | null): (el: Element) => Box;
|
|
61
84
|
/**
|
|
62
85
|
* Create a FLIP engine.
|
|
63
86
|
*
|
|
@@ -88,6 +111,7 @@ export declare function createFlipEngine(deps?: Partial<FlipDeps>): FlipEngine;
|
|
|
88
111
|
export declare function trackFlipRuns(): {
|
|
89
112
|
track(run: FlipRun): void;
|
|
90
113
|
cancelAll(): void;
|
|
114
|
+
active(): boolean;
|
|
91
115
|
};
|
|
92
116
|
/**
|
|
93
117
|
* Watch a container and FLIP its children whenever its child list changes.
|
|
@@ -110,4 +134,4 @@ export declare function observeLayout(container: Element, engine: FlipEngine, op
|
|
|
110
134
|
* @complexity O(1) to install; callback cost is the caller's.
|
|
111
135
|
* @overallScore 100
|
|
112
136
|
*/
|
|
113
|
-
export declare function mutationWatcher(container: Element): (callback: () => void) => Cleanup;
|
|
137
|
+
export declare function mutationWatcher(container: Element, attribute?: string, extra?: string[]): (callback: () => void) => Cleanup;
|
|
@@ -25,6 +25,7 @@ export interface GestureVector {
|
|
|
25
25
|
export type Axis = 'x' | 'y' | 'both';
|
|
26
26
|
export type Direction = 'left' | 'right' | 'up' | 'down';
|
|
27
27
|
export interface GestureHandlers {
|
|
28
|
+
onPress?(held: boolean): void;
|
|
28
29
|
onStart?(sample: Sample): void;
|
|
29
30
|
onMove?(vector: GestureVector, sample: Sample): void;
|
|
30
31
|
onEnd?(vector: GestureVector, sample: Sample): void;
|
|
@@ -35,6 +36,10 @@ export interface GestureOptions {
|
|
|
35
36
|
/** Movement below this many pixels is a tap, not a drag. */
|
|
36
37
|
threshold?: number;
|
|
37
38
|
axis?: Axis;
|
|
39
|
+
/** Freeze the stronger axis at the first threshold-crossing move; ties choose x. */
|
|
40
|
+
lock?: 'dominant';
|
|
41
|
+
/** Opt-in: browser cancellation ends at rest instead of launching release inertia. */
|
|
42
|
+
cancelVelocity?: boolean;
|
|
38
43
|
/** Minimum speed, px/s, for a movement to count as a swipe. */
|
|
39
44
|
swipeVelocity?: number;
|
|
40
45
|
/** Hold duration in ms before `onLongPress`. Zero disables it. */
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface ImageFlightOptions {
|
|
2
|
+
image: HTMLImageElement;
|
|
3
|
+
parent: HTMLElement;
|
|
4
|
+
from: DOMRect;
|
|
5
|
+
to: DOMRect;
|
|
6
|
+
duration: number;
|
|
7
|
+
delay?: number;
|
|
8
|
+
easing: string;
|
|
9
|
+
frames?: Keyframe[];
|
|
10
|
+
lift?: number;
|
|
11
|
+
zIndex?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function scaledFrames(from: DOMRect, to: DOMRect): Keyframe[];
|
|
14
|
+
export interface ImageFlight {
|
|
15
|
+
finished: Promise<boolean>;
|
|
16
|
+
cancel(): void;
|
|
17
|
+
finish(): void;
|
|
18
|
+
reverse(): boolean;
|
|
19
|
+
}
|
|
20
|
+
/** Bound lazy-image readiness; abort and failed decodes are ordinary fallbacks. */
|
|
21
|
+
export declare function flightImageReady(image: HTMLImageElement, signal: AbortSignal): Promise<boolean>;
|
|
22
|
+
/** A fresh inert image, measured only at the two boundaries; never a subtree snapshot. */
|
|
23
|
+
export declare function flyImage(options: ImageFlightOptions): ImageFlight;
|
|
@@ -7,8 +7,9 @@ import type { Cleanup, EffectInstance } from './types.js';
|
|
|
7
7
|
* already holds the from-state, so there is no flash between compilation and activation.
|
|
8
8
|
*
|
|
9
9
|
* Repeat activation of the same instance and a fresh instance's first activation both can meet a
|
|
10
|
-
* browser-level animation already sitting `finished
|
|
11
|
-
*
|
|
10
|
+
* browser-level animation already sitting `finished`. A second `activate()` on a click-gated
|
|
11
|
+
* toggle (a card flip) reverses playback, while an unpaired remote trigger or split hover uses
|
|
12
|
+
* the same forward restart as a first activation. For a toggle, reversing playback is
|
|
12
13
|
* the correct repeat — the property write only matters on the paused-to-running edge, so writing
|
|
13
14
|
* the same value again is a no-op the browser silently ignores, which is what made two-state
|
|
14
15
|
* effects look permanently stuck. A fresh instance's *first* activation meeting a `finished`
|
|
@@ -19,11 +20,13 @@ import type { Cleanup, EffectInstance } from './types.js';
|
|
|
19
20
|
* @param el - Element carrying the compiled animation.
|
|
20
21
|
* @param ledger - Ledger owning the play-state write.
|
|
21
22
|
* @param animationNames - Exact keyframe names emitted by the compiled plan.
|
|
23
|
+
* @param mode - `true` for a scrubbed instance, or `restart` for forward replay.
|
|
24
|
+
* @param repeatDelays - Gaps in milliseconds at opted-in animation-name positions.
|
|
22
25
|
* @returns A lifecycle handle over the element's owned CSS animations.
|
|
23
26
|
* @complexity O(a) per call in the number of running animations; O(1) space.
|
|
24
27
|
* @overallScore 100
|
|
25
28
|
*/
|
|
26
|
-
export declare function createCssInstance(el: Element, ledger: StyleLedger, animationNames: readonly string[],
|
|
29
|
+
export declare function createCssInstance(el: Element, ledger: StyleLedger, animationNames: readonly string[], mode?: boolean | 'restart', repeatDelays?: ReadonlyMap<number, number>): EffectInstance;
|
|
27
30
|
/**
|
|
28
31
|
* What a *finite* JS primitive's setup returns instead of a bare teardown.
|
|
29
32
|
*
|
|
@@ -116,6 +119,8 @@ export interface JsInstanceHooks {
|
|
|
116
119
|
* deferred setup only learns which kind it is once it has run. See `EffectInstance.continuous`.
|
|
117
120
|
*/
|
|
118
121
|
continuous?(): boolean;
|
|
122
|
+
/** Whether the last run produced a real completion. See `EffectInstance.finite`. */
|
|
123
|
+
finite?(): boolean;
|
|
119
124
|
}
|
|
120
125
|
/**
|
|
121
126
|
* Build a JS-rendered instance from a primitive's hooks, filling in the optional operations.
|
|
@@ -127,3 +132,22 @@ export interface JsInstanceHooks {
|
|
|
127
132
|
* @overallScore 100
|
|
128
133
|
*/
|
|
129
134
|
export declare function createJsInstance(hooks: JsInstanceHooks): EffectInstance;
|
|
135
|
+
/**
|
|
136
|
+
* Replay a finite JS instance `repeat:` times, or forever.
|
|
137
|
+
*
|
|
138
|
+
* Each iteration is `inner.activate()` again: `deferredInstance` re-runs a finished setup from a
|
|
139
|
+
* clean slate, so replay needs no new mechanism, only a loop. The next iteration is scheduled on
|
|
140
|
+
* the next animation frame, never a microtask, so a run that completes instantly cannot starve the
|
|
141
|
+
* event loop. The loop stops when `inner.finite` is not `true` — a setup that bailed out with a
|
|
142
|
+
* bare cleanup is indistinguishable by shape from a real run, and looping it would spin.
|
|
143
|
+
*
|
|
144
|
+
* Rejected: inferring repeatability at runtime for every JS instance — the compile-time warning
|
|
145
|
+
* would then lie for continuous effects. Repeatability is declared on the primitive instead.
|
|
146
|
+
*
|
|
147
|
+
* @param inner - The instance to replay.
|
|
148
|
+
* @param repeat - The validated `repeat:` value: a positive whole number or `infinite`.
|
|
149
|
+
* @param win - Window supplying `requestAnimationFrame`.
|
|
150
|
+
* @complexity O(1) time and space per iteration.
|
|
151
|
+
* @overallScore 100
|
|
152
|
+
*/
|
|
153
|
+
export declare function repeatedInstance(inner: EffectInstance, repeat: string, win: Window): EffectInstance;
|
|
@@ -3,13 +3,15 @@ import type { CompiledPlan } from './compile.js';
|
|
|
3
3
|
import type { StyleLedger } from './owned-styles.js';
|
|
4
4
|
import type { Reporter } from './reporter.js';
|
|
5
5
|
import type { ScrollRoot, ScrollScheduler } from './scroll-scheduler.js';
|
|
6
|
-
import type { EffectInstance } from './types.js';
|
|
6
|
+
import type { EffectInstance, Timeline } from './types.js';
|
|
7
7
|
/** Everything `JsEffectPreparer.prepare` needs, grouped so the call site reads as one request. */
|
|
8
8
|
export interface PrepareJsEffectsRequest {
|
|
9
|
+
timeline?: Timeline;
|
|
9
10
|
el: Element;
|
|
10
11
|
plan: CompiledPlan;
|
|
11
12
|
signal: AbortSignal;
|
|
12
13
|
ledger: StyleLedger;
|
|
14
|
+
cancel?: () => void;
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
15
17
|
* Wires up an element's JS-rendered effects and hands each one the context it needs to run.
|
|
@@ -38,11 +38,12 @@ export interface StyleLedger {
|
|
|
38
38
|
* Create a ledger over one element's inline style.
|
|
39
39
|
*
|
|
40
40
|
* @param el - Element whose inline style is managed.
|
|
41
|
+
* @param restoreProperty - Optional guard for properties another owner may have restored first.
|
|
41
42
|
* @returns A ledger that can restore the element to its pre-effect inline state.
|
|
42
43
|
* @complexity O(1) per write; O(n) space and O(n) time to restore, in properties written.
|
|
43
44
|
* @overallScore 100
|
|
44
45
|
*/
|
|
45
|
-
export declare function createStyleLedger(el: Element): StyleLedger;
|
|
46
|
+
export declare function createStyleLedger(el: Element, restoreProperty?: (property: string) => boolean): StyleLedger;
|
|
46
47
|
export interface AttributeLedger {
|
|
47
48
|
set(name: string, value: string): void;
|
|
48
49
|
restore(): void;
|
|
@@ -11,7 +11,7 @@ export interface ValidationResult {
|
|
|
11
11
|
* @param spec - The parameter's declared type, default, and target custom property.
|
|
12
12
|
* @returns The accepted value, or the declared default with a reason when rejected. Never throws
|
|
13
13
|
* and never returns an unvalidated string.
|
|
14
|
-
* @complexity O(n) time in value length; O(
|
|
14
|
+
* @complexity O(n) time in value length; O(d) stack space for numeric function nesting depth d.
|
|
15
15
|
* @overallScore 100
|
|
16
16
|
*/
|
|
17
17
|
export declare function validate(raw: string, spec: ParamSpec): ValidationResult;
|
|
@@ -45,8 +45,7 @@ export declare function decimalNumber(raw: string, shift?: number): string | und
|
|
|
45
45
|
* The escape screen on its own, for a value that has no type to be validated against.
|
|
46
46
|
*
|
|
47
47
|
* Every authored value normally reaches `style.setProperty` through {@link validate}, which runs
|
|
48
|
-
* this screen and then a type match.
|
|
49
|
-
* step (and its `cascade:` spelling inside `data-kui`) has always been passed through verbatim so
|
|
48
|
+
* this screen and then a type match. The group time in `cascade:` or `spread:` skips the type match so
|
|
50
49
|
* that `var(--speed)` and `calc(90ms * 2)` work, and narrowing it to a `<time>` literal now would
|
|
51
50
|
* break every group written against that promise. That left it as the one authored string in the
|
|
52
51
|
* library with no screen at all — and `data-kui` is explicitly not assumed to be site-owner text
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Activation, ParsedValue } from './types.js';
|
|
2
|
+
export declare const EASING_KEYWORDS: ReadonlySet<string>;
|
|
2
3
|
/**
|
|
3
4
|
* Split on a delimiter, ignoring delimiters nested inside parentheses or quotes.
|
|
4
5
|
*
|
|
@@ -39,6 +40,25 @@ export declare function parseActivationAttribute(input: string | null): ParsedAc
|
|
|
39
40
|
* @overallScore 100
|
|
40
41
|
*/
|
|
41
42
|
export declare function parse(input: string): ParsedValue;
|
|
43
|
+
/** A wrapper that declares group timing without declaring an effect of its own. */
|
|
44
|
+
export declare function isGroupOnly(parsed: ParsedValue): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Every element-scoped key word the parser hoists, in the author's spelling (`on`, not
|
|
47
|
+
* `activation`). Exported so `play()`'s attribute overlay can tell an element-wide key from a
|
|
48
|
+
* per-effect parameter without keeping a second list that drifts when a hoist is added.
|
|
49
|
+
*/
|
|
50
|
+
export declare const ELEMENT_HOIST_KEYS: readonly string[];
|
|
51
|
+
/**
|
|
52
|
+
* What kind of token one whitespace-separated piece of a `data-kui` segment is.
|
|
53
|
+
*
|
|
54
|
+
* Exported for the same reason as {@link ELEMENT_HOIST_KEYS}: `play()` rewrites a single token of
|
|
55
|
+
* an authored segment and must classify it with the parser's own rules (`cubic-bezier(.2,.8,.2,1)`
|
|
56
|
+
* is an easing, `600ms` is a time, `a:b` is a pair), not a regex that copies them.
|
|
57
|
+
*
|
|
58
|
+
* @complexity O(n) time in token length; O(1) space.
|
|
59
|
+
* @overallScore 100
|
|
60
|
+
*/
|
|
61
|
+
export declare function tokenKind(token: string): 'pair' | 'time' | 'easing' | 'unknown';
|
|
42
62
|
/**
|
|
43
63
|
* Write a hoisted value once. A second, differing value across segments is an authoring mistake;
|
|
44
64
|
* first one wins so behaviour stays deterministic.
|
|
@@ -46,4 +66,4 @@ export declare function parse(input: string): ParsedValue;
|
|
|
46
66
|
* @complexity O(1) time, O(1) space.
|
|
47
67
|
* @overallScore 100
|
|
48
68
|
*/
|
|
49
|
-
export declare function assignOnce<K extends 'activation' | 'timeline' | 'threshold' | 'actions' | 'cascade' | 'spread' | 'order' | 'cols' | 'along' | 'rm' | 'func'>(result: ParsedValue, key: K, value: ParsedValue[K], label: string): void;
|
|
69
|
+
export declare function assignOnce<K extends 'activation' | 'via' | 'timeline' | 'range' | 'threshold' | 'actions' | 'cascade' | 'spread' | 'order' | 'cols' | 'along' | 'rm' | 'func' | 'every'>(result: ParsedValue, key: K, value: ParsedValue[K], label: string): void;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Cleanup } from './types.js';
|
|
2
|
+
/** The ancestor marker a pause control writes on the container whose subtree it pauses. */
|
|
3
|
+
export declare const PAUSE_SCOPE_ATTR = "data-kui-paused";
|
|
4
|
+
/** Dispatched (bubbling) whenever a scope's paused state changes, so schedulers can re-evaluate. */
|
|
5
|
+
export declare const PAUSE_SCOPE_EVENT = "kui:pausescope";
|
|
6
|
+
/**
|
|
7
|
+
* Whether `el`, or any ancestor, sits inside a paused scope.
|
|
8
|
+
*
|
|
9
|
+
* Mirrors `timeScaleOf`: the state is an attribute on an ancestor rather than a registry, so a
|
|
10
|
+
* scheduler needs no handle on whatever primitive wrote it and nothing here has to be torn down.
|
|
11
|
+
*
|
|
12
|
+
* @complexity O(h) in ancestor depth; O(1) space.
|
|
13
|
+
* @overallScore 100
|
|
14
|
+
*/
|
|
15
|
+
export declare function isPausedByScope(el: Element): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Announce that a scope paused or resumed.
|
|
18
|
+
*
|
|
19
|
+
* Built with the document's own realm's `CustomEvent` (a scope in an iframe is heard by that
|
|
20
|
+
* iframe's schedulers) and bubbled from `source` so a listener on the document sees it. Lives here
|
|
21
|
+
* beside the event name so the writer and the readers cannot disagree on the shape.
|
|
22
|
+
*
|
|
23
|
+
* @complexity O(depth) for the bubble; O(1) space.
|
|
24
|
+
* @overallScore 100
|
|
25
|
+
*/
|
|
26
|
+
export declare function announcePauseScope(doc: Document, source: Element): void;
|
|
27
|
+
/**
|
|
28
|
+
* Call `onChange` with `el`'s current scope-paused state whenever any scope announces a change.
|
|
29
|
+
*
|
|
30
|
+
* One listener on the document with a re-evaluation on every event, not a listener per scope: the
|
|
31
|
+
* state is read fresh through `isPausedByScope`, so an event from an unrelated scope costs one
|
|
32
|
+
* `closest` and reports an unchanged value, and the watcher never has to know which scope an
|
|
33
|
+
* element belongs to (the same shape as the deck viewer's listener). The callback fires only when
|
|
34
|
+
* the value differs from the last one it was given, so a scheduler can treat each call as an edge.
|
|
35
|
+
*
|
|
36
|
+
* @returns A cleanup that removes the listener.
|
|
37
|
+
* @complexity O(1) to register; O(h) per announced event; O(1) space.
|
|
38
|
+
* @overallScore 100
|
|
39
|
+
*/
|
|
40
|
+
export declare function watchPauseScope(el: Element, doc: Document, onChange: (paused: boolean) => void): Cleanup;
|
|
@@ -36,8 +36,8 @@ export interface PlayRequest {
|
|
|
36
36
|
/**
|
|
37
37
|
* Play an effect on a selection, returning a handle rather than a bare promise.
|
|
38
38
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
39
|
+
* Keep the first authored step with the requested name and write explicit overrides back to
|
|
40
|
+
* `data-kui`. If no step matches, serialize the effect and options as a new attribute value.
|
|
41
41
|
*
|
|
42
42
|
* @param request - Animator, root, target selection, and effect name.
|
|
43
43
|
* @param options - Timing and effect parameters.
|