kuinetic 0.3.0 → 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/{chunk-7NW4OLOC.mjs → chunk-CG37RODK.mjs} +906 -428
- package/dist/esm/{chunk-DAVDOYOS.mjs → chunk-W7U4A2NK.mjs} +625 -124
- package/dist/esm/{chunk-4QKMEDM4.mjs → chunk-Y2FP56K5.mjs} +2501 -1694
- package/dist/esm/core/index.mjs +2 -2
- package/dist/esm/effects/index.mjs +2 -2
- package/dist/esm/index.mjs +3 -3
- package/dist/esm/notes/index.mjs +75 -8
- package/dist/kuinetic.all.js +3977 -2221
- package/dist/kuinetic.all.min.js +4 -2
- package/dist/kuinetic.css +1248 -46
- package/dist/kuinetic.js +3976 -2220
- package/dist/kuinetic.min.css +1 -1
- package/dist/kuinetic.min.js +3 -1
- package/dist/kuinetic.notes.js +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 +4 -0
- 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/element-config.d.ts +3 -4
- package/dist/types/core/instances.d.ts +27 -3
- package/dist/types/core/params.d.ts +1 -2
- package/dist/types/core/parse.d.ts +20 -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 +16 -1
- 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 +65 -18
- package/dist/types/effects/auto-motion.d.ts +20 -123
- package/dist/types/effects/carousel/deck.d.ts +5 -0
- package/dist/types/effects/carousel/drag.d.ts +5 -0
- package/dist/types/effects/carousel/row-copies.d.ts +3 -0
- package/dist/types/effects/carousel/shape-fit.d.ts +8 -0
- package/dist/types/effects/catalog/feedback.d.ts +1 -1
- package/dist/types/effects/catalog/media-shared.d.ts +10 -0
- package/dist/types/effects/catalog/pause-scope.d.ts +20 -0
- package/dist/types/effects/catalog/text-shared.d.ts +4 -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/svg/morph-loop.d.ts +2 -0
- package/dist/types/effects/tween/waypoints.d.ts +1 -1
- package/dist/types/showcase/media-source.d.ts +1 -0
- package/dist/types/showcase/youtube.d.ts +3 -0
- package/package.json +1 -1
|
@@ -1,131 +1,27 @@
|
|
|
1
|
+
import { clampPeriod, createAutoMotion } from '../core/auto-motion.js';
|
|
2
|
+
import type { AutoMotion, AutoMotionRequest } from '../core/auto-motion.js';
|
|
1
3
|
import type { PrepareContext } from '../core/effect-context.js';
|
|
2
4
|
import type { Cleanup, EffectParams, ParamSpec } from '../core/types.js';
|
|
3
5
|
import type { ControlGroup } from './step-index.js';
|
|
6
|
+
export { clampPeriod, createAutoMotion };
|
|
7
|
+
export type { AutoMotion, AutoMotionRequest };
|
|
4
8
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* the transition back and forth (a frame-driven spin must not also be eased), and how to tear down.
|
|
20
|
-
*
|
|
21
|
-
* ## Why `requestAnimationFrame` writing the deck's own position, and not a CSS animation
|
|
22
|
-
*
|
|
23
|
-
* The obvious CSS answer — register `--kui-step-position` with `@property` and run an infinite
|
|
24
|
-
* linear `@keyframes` over it — fails the one requirement that matters most here: a drag, a click
|
|
25
|
-
* and the spin must all move *one* number. A CSS animation owns its value; the drag would have to
|
|
26
|
-
* read the animated position back out of `getComputedStyle` at `pointerdown`, cancel the animation,
|
|
27
|
-
* drive the deck from JavaScript, and then restart the keyframe at a negative `animation-delay`
|
|
28
|
-
* computed to land on wherever the release settled. That is two sources of truth reconciled by
|
|
29
|
-
* arithmetic on every hand-off, and the "no snap-back when spin resumes" requirement is precisely
|
|
30
|
-
* the bug that reconciliation produces when it is off by one frame.
|
|
31
|
-
*
|
|
32
|
-
* Writing the continuous `position` the deck already has (the same number the drag moves and the
|
|
33
|
-
* controls set) makes the hand-off free: pausing is "stop adding to it", resuming is "start adding
|
|
34
|
-
* to it again", and a drag in between simply moved it. It costs nothing the CSS route would have
|
|
35
|
-
* saved — an animated custom property is recomputed on the main thread either way, because the
|
|
36
|
-
* geometry reading it is a `calc()` the compositor cannot run.
|
|
37
|
-
*
|
|
38
|
-
* `autoplay:` does not need frames at all: it is a timer that presses "next", and the stylesheet's
|
|
39
|
-
* own transition does the travel, exactly as it does for a click. Same model as
|
|
40
|
-
* `showcase/slideshow.ts`'s `autoplay:`, whose pause rules this mirrors.
|
|
41
|
-
*/
|
|
42
|
-
/**
|
|
43
|
-
* The shortest period either kind of motion may be set to, in milliseconds.
|
|
44
|
-
*
|
|
45
|
-
* The same floor `slideshow`'s `autoplay:` has and for the same reason: below it, content moves
|
|
46
|
-
* faster than it can be read, and a whole ring turning in under two seconds is a strobe rather than
|
|
47
|
-
* a carousel. Clamped with a warning rather than refused, so a typo still produces a working deck.
|
|
48
|
-
*/
|
|
49
|
-
export declare const MIN_PERIOD_MS = 2000;
|
|
50
|
-
/**
|
|
51
|
-
* The longest frame a spin will integrate over, in milliseconds.
|
|
52
|
-
*
|
|
53
|
-
* A dropped frame or a debugger pause otherwise arrives as one enormous `dt` and the ring leaps.
|
|
54
|
-
* Capping it turns a hitch into a brief slow-down, which is the less surprising failure. Resuming
|
|
55
|
-
* from a pause never relies on this — the first frame after a resume only records its timestamp.
|
|
56
|
-
*/
|
|
57
|
-
export declare const MAX_FRAME_MS = 100;
|
|
58
|
-
/**
|
|
59
|
-
* An authored signed period, floored to {@link MIN_PERIOD_MS} in magnitude.
|
|
60
|
-
*
|
|
61
|
-
* Pure and exported so the clamp and the sign rule are assertable without a clock. `0` means off
|
|
62
|
-
* and stays `0`; the sign is the direction and survives the clamp.
|
|
63
|
-
*
|
|
64
|
-
* @param ms - Authored period in milliseconds; negative runs backwards.
|
|
65
|
-
* @returns The period to run at, or `0` for off.
|
|
66
|
-
* @complexity O(1) time and space.
|
|
67
|
-
*/
|
|
68
|
-
export declare function clampPeriod(ms: number): number;
|
|
69
|
-
/**
|
|
70
|
-
* How far one frame advances the deck, in whole cycles of it.
|
|
71
|
-
*
|
|
72
|
-
* A cycle is every slide passing once — one revolution of a full ring. Expressed in cycles rather
|
|
73
|
-
* than places so the rate an author writes (`spin:40s`) is independent of how many slides there
|
|
74
|
-
* are: adding a card to a 40-second ring keeps it a 40-second ring rather than slowing each card.
|
|
75
|
-
*
|
|
76
|
-
* @param dtMs - Milliseconds since the previous frame, before capping.
|
|
77
|
-
* @param periodMs - Signed milliseconds per cycle; non-zero.
|
|
78
|
-
* @complexity O(1) time and space.
|
|
79
|
-
*/
|
|
80
|
-
export declare function cyclesFor(dtMs: number, periodMs: number): number;
|
|
81
|
-
export interface AutoMotionRequest {
|
|
82
|
-
el: Element;
|
|
83
|
-
ctx: PrepareContext;
|
|
84
|
-
/** Signed milliseconds per full cycle of continuous spin, already clamped; `0` is off. */
|
|
85
|
-
spinMs: number;
|
|
86
|
-
/** Signed milliseconds between autoplay steps, already clamped; `0` is off. */
|
|
87
|
-
autoplayMs: number;
|
|
88
|
-
/** How long a manual move takes to settle, so the motion does not resume mid-transition. */
|
|
89
|
-
settleMs: number;
|
|
90
|
-
/** Whether the pointer resting on the deck pauses it. Omitted, it does. See `HOVER_PARAM`. */
|
|
91
|
-
pauseOnHover?: boolean;
|
|
92
|
-
/**
|
|
93
|
-
* Move the deck on by a (signed) fraction of a full cycle. Absent on a deck that cannot spin; such
|
|
94
|
-
* a deck always has `spinMs` 0 (`motionPeriods`), so nothing ever calls it.
|
|
95
|
-
*/
|
|
96
|
-
advance?(cycles: number): void;
|
|
97
|
-
/** Step the deck one place. */
|
|
98
|
-
step(direction: 1 | -1): void;
|
|
99
|
-
/**
|
|
100
|
-
* Publish whether frames, rather than the stylesheet's transition, are driving the deck. Absent,
|
|
101
|
-
* and never called, on a deck that cannot spin — see `advance`.
|
|
102
|
-
*/
|
|
103
|
-
setSpinning?(spinning: boolean): void;
|
|
104
|
-
/** Called whenever the author-facing paused state changes, to mirror it onto pause controls. */
|
|
105
|
-
onPausedChange(paused: boolean): void;
|
|
106
|
-
/** Optional elapsed share of the current autoplay period; absent means no timer frames. */
|
|
107
|
-
onAutoplayProgress?(progress: number): void;
|
|
108
|
-
/** Begin as if the author's pause control were already pressed. See {@link createDeckMotion}. */
|
|
109
|
-
startPaused?: boolean;
|
|
110
|
-
}
|
|
111
|
-
export interface AutoMotion {
|
|
112
|
-
/** Whether any motion was configured at all. */
|
|
113
|
-
readonly enabled: boolean;
|
|
114
|
-
/** A person moved the deck: hand the transition back and hold off for one settle period. */
|
|
115
|
-
interrupt(): void;
|
|
116
|
-
/** A gesture is (or is no longer) in progress; nothing moves on its own while one is. */
|
|
117
|
-
hold(holding: boolean): void;
|
|
118
|
-
/** The author's pause control was pressed. */
|
|
119
|
-
toggle(): void;
|
|
120
|
-
release: Cleanup;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Start the deck's own motion and return the handle its manual inputs talk to.
|
|
124
|
-
*
|
|
125
|
-
* @returns A controller; `enabled` is false (and every method inert) when neither motion was set.
|
|
126
|
-
* @complexity O(1) per event and per frame; O(1) space.
|
|
9
|
+
* Make the author's pause control hold every other clock-driven effect on the same host.
|
|
10
|
+
*
|
|
11
|
+
* Effects composed on one element (`starfield, carousel-warp autoplay:6s`) each own a separate
|
|
12
|
+
* kind of motion, but a visitor sees one pause button and expects the whole element to stop
|
|
13
|
+
* (WCAG 2.2.2). Compiled CSS effects are gated by `animation-play-state` on the host, which is the
|
|
14
|
+
* property `control().pause()` writes, through the host's own style ledger (`ctx.style`, the same
|
|
15
|
+
* ledger object the CSS instances use). Writing it here, through that ledger, reaches every such
|
|
16
|
+
* effect on the host without this widget knowing which ones they are, and unwinds with them on
|
|
17
|
+
* teardown. It writes nothing until a pause is first pressed, so an unpaused widget leaves the
|
|
18
|
+
* other effects' own play state alone.
|
|
19
|
+
*
|
|
20
|
+
* @param ctx - The widget's prepare context; `ctx.style` is the host's ledger.
|
|
21
|
+
* @returns A setter: `true` holds the host's other effects, `false` lets them run again.
|
|
22
|
+
* @complexity O(1) time and space per call.
|
|
127
23
|
*/
|
|
128
|
-
export declare function
|
|
24
|
+
export declare function createHostPlayhead(ctx: PrepareContext): (paused: boolean) => void;
|
|
129
25
|
export declare const AUTOPLAY_PARAM: ParamSpec;
|
|
130
26
|
export declare const PAUSE_PARAM: ParamSpec;
|
|
131
27
|
export declare const HOVER_PARAM: ParamSpec;
|
|
@@ -141,6 +37,7 @@ export interface DeckMotionRequest {
|
|
|
141
37
|
/** Step the deck one place. */
|
|
142
38
|
step(direction: 1 | -1): void;
|
|
143
39
|
onAutoplayProgress?: AutoMotionRequest['onAutoplayProgress'];
|
|
40
|
+
generatedPause?: HTMLButtonElement;
|
|
144
41
|
/**
|
|
145
42
|
* The continuous half, for a deck that has a continuous position to spin (`spin:`). Omitted, the
|
|
146
43
|
* deck has no `spin:` parameter and only `autoplay:` is read.
|
|
@@ -128,6 +128,8 @@ export interface DeckLayout {
|
|
|
128
128
|
coastSpeed?(spinMs: number): number;
|
|
129
129
|
unwrapped?: boolean;
|
|
130
130
|
advanceBoth?: boolean;
|
|
131
|
+
/** Optional shape-specific pointer travel in pixels per card. */
|
|
132
|
+
travelPx?: number;
|
|
131
133
|
/** The primitive's id: names the mirrored timing properties (`--kui-<id>-duration`). */
|
|
132
134
|
id: string;
|
|
133
135
|
/** Prefix for warnings, the word an author would recognise. */
|
|
@@ -153,6 +155,8 @@ export interface DeckLayout {
|
|
|
153
155
|
begin(): void;
|
|
154
156
|
move(turns: number): void;
|
|
155
157
|
};
|
|
158
|
+
/** `'y'` when the ring is a drum (`axis:x`) and a vertical drag turns it. */
|
|
159
|
+
dragAxis?: 'x' | 'y';
|
|
156
160
|
/**
|
|
157
161
|
* The shape's own reading of a circular offset, when it is not the offset itself.
|
|
158
162
|
*
|
|
@@ -163,6 +167,7 @@ export interface DeckLayout {
|
|
|
163
167
|
placeOf?(offset: number, count: number): number;
|
|
164
168
|
/** Whether to publish the first slot's measured size for a stylesheet that derives from it. */
|
|
165
169
|
measure: boolean;
|
|
170
|
+
repeat?(originals: readonly Element[]): Element[];
|
|
166
171
|
/** Attributes the shape publishes on the host, so its selectors can branch on parameters. */
|
|
167
172
|
hostAttributes?: Record<string, string>;
|
|
168
173
|
/**
|
|
@@ -32,6 +32,11 @@ export interface RingDragRequest {
|
|
|
32
32
|
begin(): void;
|
|
33
33
|
move(turns: number): void;
|
|
34
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* `'y'` for a drum (`axis:x`): the vertical movement turns it, dragging down advances it (the card
|
|
37
|
+
* waiting at the top follows the hand down). Absent or `'x'` is the ring's horizontal drag.
|
|
38
|
+
*/
|
|
39
|
+
dragAxis?: 'x' | 'y';
|
|
35
40
|
/** Move the ring to a continuous position and re-render. */
|
|
36
41
|
moveTo(position: number): void;
|
|
37
42
|
/** Publish or clear the dragging state the stylesheet suspends its transition on. */
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { PrepareContext } from '../../core/effect-context.js';
|
|
2
2
|
/** Marks a row's extra image. It is never a slide, whatever selector the deck was given. */
|
|
3
3
|
export declare const ROW_COPY_ATTR = "data-kui-row-copy";
|
|
4
|
+
export declare const RING_COPY_ATTR = "data-kui-ring-copy";
|
|
5
|
+
/** Copy only an image's visuals, never its IDs, effects or semantics. */
|
|
6
|
+
export declare function copySlideImage(image: HTMLImageElement): HTMLImageElement;
|
|
4
7
|
/** Image sources can change without changing a fixed-size image's observed box. */
|
|
5
8
|
export declare function watchCopySources(host: Element, ctx: PrepareContext, refresh: () => void): () => void;
|
|
6
9
|
/** Fresh image visuals only: never duplicate links, IDs, effects or semantic slides. */
|
|
@@ -36,7 +36,15 @@ export interface ShapeFitRequest {
|
|
|
36
36
|
arc: number;
|
|
37
37
|
tilt: number;
|
|
38
38
|
sphere?: boolean;
|
|
39
|
+
drum?: boolean;
|
|
39
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* A drum's silhouette: `translateZ(-r) rotateY(t) rotateX(a) translateZ(r)` applied to each corner.
|
|
43
|
+
*
|
|
44
|
+
* Only the front half is sampled, because `backface-visibility: hidden` hides the rest, so the
|
|
45
|
+
* reach is the cards that can actually be seen. The host's own `rotateY(t)` is the ring tilt.
|
|
46
|
+
*/
|
|
47
|
+
export declare function projectDrum(g: HelixGeometry): ProjectedBounds;
|
|
40
48
|
/** A sphere's silhouette is a circle at any rotation, so it needs no sampling and stays right under a second axis. */
|
|
41
49
|
export declare function projectSphere(g: HelixGeometry): ProjectedBounds;
|
|
42
50
|
/** Observe geometry only; the moving deck never asks this solver for a frame. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Preset, Primitive } from '../../core/types.js';
|
|
2
|
-
import type
|
|
2
|
+
import { type Registry } from '../../core/registry.js';
|
|
3
3
|
/**
|
|
4
4
|
* Feedback & status effects (catalog section K). Loading indicators default to `load` and
|
|
5
5
|
* `reducedMotion: 'disable'` — an infinite loop shortened to 1ms strobes rather than stopping,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { SplitStage } from '../../core/registry.js';
|
|
2
|
+
import type { Reporter } from '../../core/reporter.js';
|
|
1
3
|
import type { Cleanup, EffectParams } from '../../core/types.js';
|
|
2
4
|
/**
|
|
3
5
|
* DOM-surgery helpers behind `slat-assemble` (catalog section G).
|
|
@@ -103,6 +105,14 @@ export interface SlatBuildOptions {
|
|
|
103
105
|
from: SlatFrom;
|
|
104
106
|
fold: boolean;
|
|
105
107
|
}
|
|
108
|
+
/** Each moving cell clips its own offset copy of the same full-size paint surface. */
|
|
109
|
+
export declare function installTileStage(host: Element, grid: {
|
|
110
|
+
hoists?: {
|
|
111
|
+
cols?: string;
|
|
112
|
+
};
|
|
113
|
+
rows?: string;
|
|
114
|
+
tileFit?: 'stretch';
|
|
115
|
+
}, reporter: Reporter): SplitStage | undefined;
|
|
106
116
|
export declare function installSlatStage(el: Element, doc: Document, win: Window, options: SlatBuildOptions): SlatStage | null;
|
|
107
117
|
/**
|
|
108
118
|
* Forward validated timing params onto the stage, so `media.css`'s `--kui-i * --kui-stagger`
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Registry } from '../../core/registry.js';
|
|
2
|
+
import type { Preset, Primitive } from '../../core/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Pauses everything under a container from the author's own button.
|
|
5
|
+
*
|
|
6
|
+
* Writes `data-kui-paused` on the host (the stylesheet freezes every CSS animation beneath it and
|
|
7
|
+
* every scheduler reads it through `isPausedByScope`), holds the subtree's script animations,
|
|
8
|
+
* mirrors `aria-pressed` onto each `pause:` control, and announces each change so schedulers
|
|
9
|
+
* re-evaluate. It is a control, so it keeps working under reduced motion.
|
|
10
|
+
*/
|
|
11
|
+
export declare const PAUSE_SCOPE_PRIMITIVE: Primitive;
|
|
12
|
+
export declare const PAUSE_SCOPE_PRESETS: Preset[];
|
|
13
|
+
/**
|
|
14
|
+
* Register the section-wide pause control.
|
|
15
|
+
*
|
|
16
|
+
* @param registry - Registry to populate.
|
|
17
|
+
* @returns The same registry, for chaining.
|
|
18
|
+
* @complexity O(1) time and space.
|
|
19
|
+
*/
|
|
20
|
+
export declare function registerPauseScope(registry: Registry): Registry;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import type { SplitStage } from '../../core/registry.js';
|
|
2
|
+
import type { Reporter } from '../../core/reporter.js';
|
|
1
3
|
import type { Cleanup, EffectParams, EffectSpec, EffectVariant, ParameterSchema } from '../../core/types.js';
|
|
2
4
|
/** How `split-text` breaks a string into decorative pieces. */
|
|
3
5
|
export type SplitUnit = 'chars' | 'words' | 'lines';
|
|
6
|
+
/** Mount the decorative pieces for a `split:` group, not for a text effect. */
|
|
7
|
+
export declare function installTextStage(host: Element, unit: 'chars' | 'words', reporter: Reporter): SplitStage | undefined;
|
|
4
8
|
/**
|
|
5
9
|
* Selector for the elements a content-mutating text/number effect must never remove from the DOM:
|
|
6
10
|
* a link, a form control, anything focusable or already interactive. Every primitive that takes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PrepareContext } from '../../core/effect-context.js';
|
|
2
|
+
import type { ContinuousSetup } from '../../core/instances.js';
|
|
3
|
+
import type { Cleanup, EffectParams } from '../../core/types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Give a snap strip an `autoplay:` that steps through its items, on the carousel's own scheduler.
|
|
6
|
+
*
|
|
7
|
+
* Returns `null` (after warning where it is the author's mistake) when autoplay is not asked for or
|
|
8
|
+
* cannot be honoured, so the caller keeps its plain cleanup. The pause rules — offscreen, hidden
|
|
9
|
+
* tab, hover and focus, the `pause:` control, the 2s floor — all live in `createDeckMotion`; the
|
|
10
|
+
* only things supplied here are how to step and when a person has taken over.
|
|
11
|
+
*
|
|
12
|
+
* @complexity O(n) per step in the number of items; O(1) space.
|
|
13
|
+
*/
|
|
14
|
+
export declare function startSnapAutoplay(request: {
|
|
15
|
+
el: Element;
|
|
16
|
+
items: Element[];
|
|
17
|
+
params: EffectParams;
|
|
18
|
+
ctx: PrepareContext;
|
|
19
|
+
release: Cleanup;
|
|
20
|
+
}): ContinuousSetup | null;
|
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
import type { Cleanup, EffectParams } from '../core/types.js';
|
|
1
|
+
import type { Cleanup, EffectParams, ParamSpec } from '../core/types.js';
|
|
2
2
|
import type { PrepareContext } from '../core/effect-context.js';
|
|
3
|
+
export declare const DECK_CONTROLS_ATTR = "data-kui-deck-controls";
|
|
4
|
+
export declare const DECK_CONTROLS_PARAM: ParamSpec;
|
|
5
|
+
/** Authored selectors keep their inside-first lookup even when the deck adds its own buttons. */
|
|
6
|
+
export declare function queryDeckControls(el: Element, ctx: PrepareContext, selector: string): Element[];
|
|
7
|
+
export declare function suppressSlideImageDrag(slides: Iterable<Element>): Cleanup;
|
|
8
|
+
export declare function createDeckControls(request: {
|
|
9
|
+
el: Element;
|
|
10
|
+
params: EffectParams;
|
|
11
|
+
slides: readonly Element[];
|
|
12
|
+
spatial?: boolean;
|
|
13
|
+
step(direction: 1 | -1): void;
|
|
14
|
+
jump(index: number): void;
|
|
15
|
+
}): {
|
|
16
|
+
pause: HTMLButtonElement | undefined;
|
|
17
|
+
mark(index: number, drift?: number): void;
|
|
18
|
+
updateDistance: (drift: number) => void;
|
|
19
|
+
release(): void;
|
|
20
|
+
} | undefined;
|
|
3
21
|
export interface StepIndexOptions {
|
|
4
22
|
el: Element;
|
|
5
23
|
params: EffectParams;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { PrepareContext } from '../../core/effect-context.js';
|
|
2
2
|
import type { SetupResult } from '../../core/instances.js';
|
|
3
3
|
import type { EffectParams } from '../../core/types.js';
|
|
4
|
+
/** Resolve a fragment in the path's own root and snapshot its geometry at setup. */
|
|
5
|
+
export declare function resolveMorphDestination(path: Element, value: string, warn: PrepareContext['warn']): string | undefined;
|
|
4
6
|
/** An opt-in loop; the interactive morph's listeners, timing and geometry remain separate. */
|
|
5
7
|
export declare function prepareMorphLoop(path: Element, params: EffectParams, ctx: PrepareContext): SetupResult;
|
|
@@ -33,7 +33,7 @@ import type { TweenGroup } from './properties.js';
|
|
|
33
33
|
* this number. Five states keeps this static vocabulary bounded. Longer choreography needs another keyframe
|
|
34
34
|
* definition; two effects on the same property cannot bypass this budget by composing.
|
|
35
35
|
*/
|
|
36
|
-
export declare const MAX_WAYPOINTS =
|
|
36
|
+
export declare const MAX_WAYPOINTS = 8;
|
|
37
37
|
/**
|
|
38
38
|
* One property group's waypoint shape, as read off the attribute.
|
|
39
39
|
*
|
|
@@ -4,6 +4,7 @@ export interface MediaSource {
|
|
|
4
4
|
embedUrl: string;
|
|
5
5
|
aspect: 'wide' | 'tall';
|
|
6
6
|
}
|
|
7
|
+
export declare function isYouTubeId(id: string | null | undefined): id is string;
|
|
7
8
|
/**
|
|
8
9
|
* Resolve a real link into a supported player source. Unknown hosts and non-web schemes keep
|
|
9
10
|
* their normal link behavior; no attacker-controlled URL is handed to an iframe.
|