@steamfield/decks 0.0.0-stage → 1.0.0-rc.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/LICENSE +201 -0
- package/README.md +28 -2
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +5 -0
- package/dist/index-B2n69xrC.d.ts +75 -0
- package/dist/index-BURtH7IB.d.ts +182 -0
- package/dist/index-BV_-6L5L.d.ts +136 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6 -0
- package/dist/kit/chrome/od-byline.css +7 -0
- package/dist/kit/chrome/od-cover-head.css +10 -0
- package/dist/kit/chrome/od-eyebrow.css +13 -0
- package/dist/kit/chrome/od-logo.css +167 -0
- package/dist/kit/chrome/od-qr-card.css +30 -0
- package/dist/kit/ink/code-ink.css +83 -0
- package/dist/kit/ink/graph-3d.css +29 -0
- package/dist/kit/ink/ink-bars.css +7 -0
- package/dist/kit/ink/ink-card-rect.css +6 -0
- package/dist/kit/ink/ink-chip.css +62 -0
- package/dist/kit/ink/ink-line.css +7 -0
- package/dist/kit/ink/ink-number.css +22 -0
- package/dist/kit/ink/ink-ping.css +4 -0
- package/dist/kit/ink/ink-rule.css +4 -0
- package/dist/kit/ink/ink-timeline-cursor.css +3 -0
- package/dist/kit/ink/ink-timeline.css +9 -0
- package/dist/kit/ink/underline.css +12 -0
- package/dist/kit/ink/unit-grid.css +3 -0
- package/dist/kit/story/story-card.css +19 -0
- package/dist/kit/story/story-link.css +13 -0
- package/dist/kit/story/story-stage.css +59 -0
- package/dist/kit/styles/base.css +82 -0
- package/dist/kit/styles/compat.css +78 -0
- package/dist/kit/styles/components.css +224 -0
- package/dist/kit/styles/fonts/inter-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/kit/styles/fonts/inter-cyrillic-wght-normal.woff2 +0 -0
- package/dist/kit/styles/fonts/inter-greek-ext-wght-normal.woff2 +0 -0
- package/dist/kit/styles/fonts/inter-greek-wght-normal.woff2 +0 -0
- package/dist/kit/styles/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/dist/kit/styles/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/kit/styles/fonts/inter-vietnamese-wght-normal.woff2 +0 -0
- package/dist/kit/styles/fonts.css +73 -0
- package/dist/kit/styles/index.css +36 -0
- package/dist/kit/styles/layout.css +181 -0
- package/dist/kit/styles/stats.css +92 -0
- package/dist/kit/styles/story-frame.css +179 -0
- package/dist/kit/styles/story-marks.css +115 -0
- package/dist/kit/styles/story-transition.css +182 -0
- package/dist/kit/styles.css +1 -0
- package/dist/kit.d.ts +880 -0
- package/dist/kit.js +3475 -0
- package/dist/layers.css +60 -0
- package/dist/layouts.css +58 -0
- package/dist/lint/ai-rhetoric-patterns.tsv +110 -0
- package/dist/lint/deck-writing-reminder.md +9 -0
- package/dist/motion.css +215 -0
- package/dist/motion.d.ts +2 -0
- package/dist/motion.js +1 -0
- package/dist/node.d.ts +63 -0
- package/dist/node.js +1 -0
- package/dist/overview-view.css +58 -0
- package/dist/play-view.css +29 -0
- package/dist/plugin/skills/building-a-deck/SKILL.md +22 -0
- package/dist/plugin/skills/building-a-deck/references/workflow.md +86 -0
- package/dist/plugin/skills/deck-data/SKILL.md +27 -0
- package/dist/plugin/skills/deck-data/references/fact-check.md +59 -0
- package/dist/plugin/skills/deck-data/references/provenance.md +61 -0
- package/dist/plugin/skills/deck-design/SKILL.md +31 -0
- package/dist/plugin/skills/deck-design/references/layout.md +55 -0
- package/dist/plugin/skills/deck-motion/SKILL.md +34 -0
- package/dist/plugin/skills/deck-motion/references/motion.md +66 -0
- package/dist/plugin/skills/visualization/SKILL.md +34 -0
- package/dist/plugin/skills/visualization/references/VENDORED.md +25 -0
- package/dist/plugin/skills/visualization/references/annotations.md +27 -0
- package/dist/plugin/skills/visualization/references/chart-selection.md +29 -0
- package/dist/plugin/skills/visualization/references/color-strategy.md +22 -0
- package/dist/plugin/skills/visualization/references/encoding-channels.md +44 -0
- package/dist/plugin/skills/visualization/references/ink.md +38 -0
- package/dist/plugin/skills/visualization/references/marks.md +33 -0
- package/dist/plugin/skills/visualization/references/presentation.md +43 -0
- package/dist/plugin/skills/working-with-decks/SKILL.md +34 -0
- package/dist/plugin/skills/working-with-decks/references/project.md +59 -0
- package/dist/plugin/skills/writing-slides/SKILL.md +45 -0
- package/dist/plugin/skills/writing-slides/references/lint.md +11 -0
- package/dist/plugin/skills/writing-slides/references/prose-patterns.md +48 -0
- package/dist/presenter-view.css +113 -0
- package/dist/print-view.module.css +32 -0
- package/dist/prose-patterns-DPqjGBFu.js +76 -0
- package/dist/prose-scan-BrWZ7gxZ.js +233 -0
- package/dist/src-C-OfT72W.js +396 -0
- package/dist/src-CmQgaG1b.js +2469 -0
- package/dist/src-DizFoqYt.js +1508 -0
- package/dist/templates/conventional/deck.config.ts +7 -0
- package/dist/templates/conventional/setup.ts +3 -0
- package/dist/templates/conventional/slides/01-cover.mdx +9 -0
- package/dist/templates/conventional/slides/02-first-point.mdx +12 -0
- package/dist/templates/conventional/styles/index.css +1 -0
- package/dist/templates/story/components/FirstStage.tsx +34 -0
- package/dist/templates/story/data/01-first.ts +8 -0
- package/dist/templates/story/data-sources.md +7 -0
- package/dist/templates/story/deck.config.ts +8 -0
- package/dist/templates/story/setup.ts +3 -0
- package/dist/templates/story/slides/01-cover.mdx +9 -0
- package/dist/templates/story/slides/02-first-point.mdx +6 -0
- package/dist/templates/story/styles/index.css +1 -0
- package/dist/transition.css +87 -0
- package/docs/README.md +28 -0
- package/docs/canvas.md +134 -0
- package/docs/cli.md +49 -0
- package/docs/code-blocks.md +132 -0
- package/docs/config.md +183 -0
- package/docs/getting-started.md +204 -0
- package/docs/kit.md +371 -0
- package/docs/migrating-from-slidev.md +45 -0
- package/docs/motion.md +396 -0
- package/docs/presenting.md +99 -0
- package/docs/slides.md +246 -0
- package/package.json +108 -4
package/dist/kit.d.ts
ADDED
|
@@ -0,0 +1,880 @@
|
|
|
1
|
+
import { a as gsap$1 } from "./index-B2n69xrC.js";
|
|
2
|
+
import { y as useSlideScale } from "./index-BURtH7IB.js";
|
|
3
|
+
import { CSSProperties, ReactNode, Ref } from "react";
|
|
4
|
+
import { ScaleLinear } from "d3-scale";
|
|
5
|
+
import { ChartSpec, GraphProps, LayerSpec, MarkEvent } from "@opendata-ai/openchart-react";
|
|
6
|
+
export declare function OdByline({ children, className }: {
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
export declare function OdCoverHead({ url, className }: {
|
|
11
|
+
url?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
export declare function OdEyebrow({ accent, children }: {
|
|
15
|
+
accent?: string;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
/**
|
|
19
|
+
* The theme's brand mark (`brand.logo`; `null` renders nothing). On the live slide its layers
|
|
20
|
+
* play the two-cycle intro and then float; everywhere else, and under instant motion, the mark
|
|
21
|
+
* is drawn settled.
|
|
22
|
+
*/
|
|
23
|
+
export declare function OdLogo({ size }: {
|
|
24
|
+
size?: number;
|
|
25
|
+
}): import("react").JSX.Element | null;
|
|
26
|
+
export declare function OdQrCard({ url, image, label, sublabel, ariaLabel }: {
|
|
27
|
+
url?: string;
|
|
28
|
+
image?: string;
|
|
29
|
+
label?: string;
|
|
30
|
+
sublabel?: string;
|
|
31
|
+
ariaLabel?: string;
|
|
32
|
+
}): import("react").JSX.Element;
|
|
33
|
+
interface Point {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
}
|
|
37
|
+
/** One data series drawn as an ink ribbon. */
|
|
38
|
+
interface Series {
|
|
39
|
+
id: string;
|
|
40
|
+
hue: string;
|
|
41
|
+
points: Point[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* One closed filled polygon of a ribbon. `d` is a 16 point path that starts
|
|
45
|
+
* with M and ends with Z. `overpaint`, when present, is the fill opacity of a
|
|
46
|
+
* darker same hue second pass over the identical polygon.
|
|
47
|
+
*/
|
|
48
|
+
interface Dab {
|
|
49
|
+
d: string;
|
|
50
|
+
fillOpacity: number;
|
|
51
|
+
overpaint?: number;
|
|
52
|
+
}
|
|
53
|
+
/** Options for brushRibbon. Every field has a default in BRUSH_DEFAULTS. */
|
|
54
|
+
interface InkOpts {
|
|
55
|
+
/** Nominal stroke width in viewBox units at the belly of the stroke. */
|
|
56
|
+
width: number;
|
|
57
|
+
/** Seed derived from data identity (series id plus index), never geometry. */
|
|
58
|
+
seed: number | string;
|
|
59
|
+
/** Fraction of the stroke spent ramping up from startWidth. */
|
|
60
|
+
taperIn: number;
|
|
61
|
+
/** Fraction of the stroke spent ramping down to endWidth. */
|
|
62
|
+
taperOut: number;
|
|
63
|
+
/** Width multiplier at the very start of the stroke. */
|
|
64
|
+
startWidth: number;
|
|
65
|
+
/** Width multiplier at the very end of the stroke. */
|
|
66
|
+
endWidth: number;
|
|
67
|
+
/** Width multiplier through the middle of the stroke. */
|
|
68
|
+
belly: number;
|
|
69
|
+
/** Per edge offset jitter amplitude in viewBox units. */
|
|
70
|
+
wobble: number;
|
|
71
|
+
/** Per vertex offset jitter amplitude in viewBox units. */
|
|
72
|
+
edge: number;
|
|
73
|
+
/** Nib shear in radians. Non zero gives the ribbon a chisel tip. */
|
|
74
|
+
chisel: number;
|
|
75
|
+
/** Arc length in viewBox units between resampled centreline points. */
|
|
76
|
+
samples: number;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Mutable so the visual gate can tune the ink without touching call sites.
|
|
80
|
+
* Sized for a 1920x1080 stage read from the back of a room, which is why
|
|
81
|
+
* wobble and edge are several times the amplitude a web page would use.
|
|
82
|
+
*/
|
|
83
|
+
export declare const BRUSH_DEFAULTS: InkOpts;
|
|
84
|
+
/**
|
|
85
|
+
* Build the dab chain for a polyline.
|
|
86
|
+
*
|
|
87
|
+
* The centreline is resampled at `samples` units of arc length. Each sample
|
|
88
|
+
* becomes one closed polygon centred on it and spanning DAB_SPAN samples, so
|
|
89
|
+
* consecutive dabs overlap by most of their length and fuse into one ribbon.
|
|
90
|
+
* The top and bottom edges follow independent low frequency drifts along the
|
|
91
|
+
* arc plus fine hashed jitter per vertex, and each dab is a shallow lens so
|
|
92
|
+
* its own ends feather into its neighbours instead of cutting a hard tile.
|
|
93
|
+
*/
|
|
94
|
+
export declare function brushRibbon(points: Point[], opts?: Partial<InkOpts>): Dab[];
|
|
95
|
+
/**
|
|
96
|
+
* Theme resolution: merge a deck's `theme.json` over `default.json`, resolve
|
|
97
|
+
* `{path.to.token}` aliases, validate, and render the CSS custom properties.
|
|
98
|
+
*
|
|
99
|
+
* Pure functions with no Node or Vite imports, so the Vite plugin in
|
|
100
|
+
* `vite.config.mts`, `default.ts` and the tests all share one code path.
|
|
101
|
+
*/
|
|
102
|
+
declare const HUE_NAMES: readonly ["cyan", "amber", "rose", "emerald", "violet", "slate"];
|
|
103
|
+
type Hue = (typeof HUE_NAMES)[number];
|
|
104
|
+
type Ramp = readonly [string, string, string, string];
|
|
105
|
+
interface BrandLogo {
|
|
106
|
+
/** The SVG `viewBox`, e.g. "0 0 32 32". */
|
|
107
|
+
"view-box": string;
|
|
108
|
+
/** Inner SVG markup, rendered inside an `<svg>` the component owns. */
|
|
109
|
+
svg: string;
|
|
110
|
+
}
|
|
111
|
+
interface Theme {
|
|
112
|
+
surfaces: Record<"canvas" | "canvas-cover" | "surface" | "surface-raised" | "muted", string>;
|
|
113
|
+
text: Record<"primary" | "secondary" | "muted" | "faint" | "dim" | "highlight", string>;
|
|
114
|
+
borders: Record<"default" | "subtle" | "rule" | "axis", string>;
|
|
115
|
+
ramps: Record<Hue, Ramp>;
|
|
116
|
+
accents: Record<"cyan" | "cyan-bright" | "cyan-soft" | "blue" | "blue-soft" | "violet" | "violet-dim" | "emerald" | "amber" | "amber-soft" | "rose" | "pink" | "slate", string>;
|
|
117
|
+
glows: Record<"primary" | "secondary" | "amber" | "violet" | "emerald" | "rose", string>;
|
|
118
|
+
categorical: string[];
|
|
119
|
+
/** `serif` defaults to `{fonts.sans}`; the story headline and cover title read it. */
|
|
120
|
+
fonts: Record<"sans" | "serif" | "mono", string>;
|
|
121
|
+
/**
|
|
122
|
+
* Shape values the addon CSS reads as `--od-<key>`. `radius` and `hairline`
|
|
123
|
+
* are CSS lengths (card corners, card and chip borders); `card-width` is the
|
|
124
|
+
* story card's width in `--lw` frame units; `dim` is the opacity of a
|
|
125
|
+
* de-emphasized mark (`InkLine` with `ghost`).
|
|
126
|
+
*/
|
|
127
|
+
shape: Record<"radius" | "hairline" | "card-width" | "dim", string>;
|
|
128
|
+
chart: Record<"text" | "gridline" | "axis" | "eyebrow" | "title" | "subtitle" | "source" | "graph-label", string>;
|
|
129
|
+
"qr-white": string;
|
|
130
|
+
brand: {
|
|
131
|
+
name: string;
|
|
132
|
+
/** Shown right-aligned on the cover row; `null` shows nothing. */
|
|
133
|
+
url: string | null;
|
|
134
|
+
"wordmark-gradient": string;
|
|
135
|
+
/** `null` renders no mark. */
|
|
136
|
+
logo: BrandLogo | null;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
type InkStep = 1 | 2 | 3 | 4;
|
|
140
|
+
export declare let CATEGORICAL_COLORS: string[];
|
|
141
|
+
export declare let CANVAS: string;
|
|
142
|
+
export declare function resolveTheme(deckTheme?: unknown): Theme;
|
|
143
|
+
export declare function installTheme(value: Theme): void;
|
|
144
|
+
export declare function theme(): Theme;
|
|
145
|
+
export declare function ink(hue: Hue, step: 1 | 2 | 3 | 4): string;
|
|
146
|
+
interface UnitGridGeometry {
|
|
147
|
+
origin?: Point;
|
|
148
|
+
cols?: number;
|
|
149
|
+
cellWidth?: number;
|
|
150
|
+
/** Defaults to square, or a page shape (1.32x as tall) for `glyph: 'sheet'`. */
|
|
151
|
+
cellHeight?: number;
|
|
152
|
+
gapX?: number;
|
|
153
|
+
gapY?: number;
|
|
154
|
+
glyph?: "square" | "sheet";
|
|
155
|
+
}
|
|
156
|
+
/** Geometry defaults, shared by `UnitGrid`'s props and the math below. */
|
|
157
|
+
export declare const UNIT_GRID_DEFAULTS: {
|
|
158
|
+
readonly glyph: "square";
|
|
159
|
+
readonly cols: 20;
|
|
160
|
+
readonly cellWidth: 16;
|
|
161
|
+
readonly gapX: 8;
|
|
162
|
+
readonly gapY: 8;
|
|
163
|
+
readonly origin: {
|
|
164
|
+
readonly x: 0;
|
|
165
|
+
readonly y: 0;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
/** Cell height after the glyph default, in stage units. */
|
|
169
|
+
export declare function unitCellHeight(geom: UnitGridGeometry): number;
|
|
170
|
+
/** Centre of cell `index`, in stage viewBox units, before any scatter or collapse. */
|
|
171
|
+
export declare function unitCellCenter(index: number, geom: UnitGridGeometry): Point;
|
|
172
|
+
/** One cell of a `UnitGrid`. */
|
|
173
|
+
interface UnitGridItem {
|
|
174
|
+
id: string;
|
|
175
|
+
/** Drives `colorBy` and, with no `colorBy`, nothing else. */
|
|
176
|
+
category?: string;
|
|
177
|
+
/** Per item ink, used when `colorBy` returns nothing. */
|
|
178
|
+
hue?: Hue;
|
|
179
|
+
step?: InkStep;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Deterministic hashing for the ink layer.
|
|
183
|
+
*
|
|
184
|
+
* Every random looking value on a story slide comes from here, keyed on data
|
|
185
|
+
* identity (series id plus index) rather than on geometry or time. That is why
|
|
186
|
+
* a resize, an HMR reload or a repaint never makes a stroke shimmer.
|
|
187
|
+
*/
|
|
188
|
+
/**
|
|
189
|
+
* Deterministic value in [0,1) for a seed and an optional index.
|
|
190
|
+
* Same arguments always give the same number.
|
|
191
|
+
*/
|
|
192
|
+
export declare function hash(seed: number | string, i?: number): number;
|
|
193
|
+
/** Deterministic value in [lo,hi) for a seed and an index. */
|
|
194
|
+
export declare function hashRange(seed: number | string, i: number, lo: number, hi: number): number;
|
|
195
|
+
/** Deterministic value in [-amp,+amp] for a seed and an index. */
|
|
196
|
+
export declare function hashSigned(seed: number | string, i: number, amp: number): number;
|
|
197
|
+
declare namespace parliament_d_exports {
|
|
198
|
+
export { ParliamentLayout, ParliamentOptions, ParliamentSeat, layout, thresholdAngle };
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Parliament (hemicycle) layout math: concentric rows of seats on a half
|
|
202
|
+
* circle centred at (0, 0), on its baseline, opening upward in SVG (negative y).
|
|
203
|
+
*
|
|
204
|
+
* Rows get seats in proportion to their radius by largest-remainder rounding,
|
|
205
|
+
* and each row spaces its seats evenly with half a step of padding at both
|
|
206
|
+
* ends. A hemicycle only reads as rows when the spacing along a row matches the
|
|
207
|
+
* gap between rows, so `layout` picks the row count and that gap from the
|
|
208
|
+
* total. Seats come back in reading order, left to right by angle; two seats at
|
|
209
|
+
* the same angle go inner row first, so the order is total and a caller can
|
|
210
|
+
* hand out contiguous wedges by index. Two rows of n and m seats share an angle
|
|
211
|
+
* whenever (2i+1)/(2n) equals (2j+1)/(2m) for some seats i and j: two odd rows
|
|
212
|
+
* meeting at the top, or rows of 3 and 9 at a sixth of the arc.
|
|
213
|
+
*
|
|
214
|
+
* ```ts
|
|
215
|
+
* const arc = layout(31, { radius: 360 })
|
|
216
|
+
* arc.seats[0] // { x, y, angle, row }: the leftmost seat, row 0 innermost
|
|
217
|
+
* const majority = thresholdAngle(arc.seats, 16) // between seat 15 and seat 16
|
|
218
|
+
* ```
|
|
219
|
+
*
|
|
220
|
+
* The geometry is generic; the drawing (seat marks, ticks, labels) stays with
|
|
221
|
+
* the deck's component until a second deck needs the same chart.
|
|
222
|
+
*/
|
|
223
|
+
interface ParliamentSeat {
|
|
224
|
+
x: number;
|
|
225
|
+
y: number;
|
|
226
|
+
/** Radians from the right-hand baseline: pi is the far left, 0 the far right. */
|
|
227
|
+
angle: number;
|
|
228
|
+
/** 0 is the innermost row. */
|
|
229
|
+
row: number;
|
|
230
|
+
}
|
|
231
|
+
interface ParliamentLayout {
|
|
232
|
+
/** Every seat, in reading order (angle descending, then row ascending). */
|
|
233
|
+
seats: ParliamentSeat[];
|
|
234
|
+
/** One radius per row, innermost first; the last equals `radius`. */
|
|
235
|
+
rowRadii: number[];
|
|
236
|
+
/** Seats per row, innermost first. */
|
|
237
|
+
rowSeats: number[];
|
|
238
|
+
/** Radial distance between adjacent rows (the one row's seat spacing when `rows` is 1). */
|
|
239
|
+
rowGap: number;
|
|
240
|
+
/** A seat radius that leaves a clear gap to every neighbour. */
|
|
241
|
+
seatRadius: number;
|
|
242
|
+
}
|
|
243
|
+
interface ParliamentOptions {
|
|
244
|
+
/** Outer row radius, in the caller's units. */
|
|
245
|
+
radius: number;
|
|
246
|
+
/** Row count. Defaults to the count whose inner radius lands near `INNER_SHARE` of `radius`. */
|
|
247
|
+
rows?: number;
|
|
248
|
+
/** Radial gap between rows. Defaults to the gap at which spacing along a row matches it. */
|
|
249
|
+
rowGap?: number;
|
|
250
|
+
}
|
|
251
|
+
/** Seat positions for `total` seats over concentric rows ending at `radius`. */
|
|
252
|
+
declare function layout(total: number, options: ParliamentOptions): ParliamentLayout;
|
|
253
|
+
/**
|
|
254
|
+
* The angle of a threshold after the first `at` seats in reading order: the
|
|
255
|
+
* mean angle of the seats either side, so a radial tick there passes through
|
|
256
|
+
* neither. `at` 0 is the left baseline (pi) and `at` equal to the seat count the
|
|
257
|
+
* right one (0). Two seats at the same angle cannot be split by a radial line,
|
|
258
|
+
* so a threshold that falls between them throws rather than drawing through
|
|
259
|
+
* both; move the threshold or change the row count.
|
|
260
|
+
*/
|
|
261
|
+
declare function thresholdAngle(seats: readonly ParliamentSeat[], at: number): number;
|
|
262
|
+
interface RippleOptions {
|
|
263
|
+
/**
|
|
264
|
+
* Distance, in stage units, at which a mark starts last. Pass the farthest
|
|
265
|
+
* mark's distance from `from` so the wave spans the field; the default is
|
|
266
|
+
* the stage diagonal, which on a small field gives a shallow ripple.
|
|
267
|
+
*/
|
|
268
|
+
reach?: number;
|
|
269
|
+
/**
|
|
270
|
+
* Seed for a small hashed jitter, so two marks at the same distance do not
|
|
271
|
+
* move in lockstep. No seed, no jitter. Seed from data identity.
|
|
272
|
+
*/
|
|
273
|
+
seed?: string | number;
|
|
274
|
+
/** The mark's index under `seed`. */
|
|
275
|
+
index?: number;
|
|
276
|
+
/** Jitter amplitude as a share of the stagger window. Defaults to 0.08. */
|
|
277
|
+
jitter?: number;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* A mark's local progress when the beat field `t` ripples outward from
|
|
281
|
+
* `from`. `stagger` is the share of the field spent on the spread (0..1):
|
|
282
|
+
* 0 returns `t` (clamped to 0..1), so every mark moves together.
|
|
283
|
+
*/
|
|
284
|
+
export declare function rippleProgress(t: number, at: Point, from: Point, stagger: number, opts?: RippleOptions): number;
|
|
285
|
+
/** Linear interpolation, including extrapolation beyond the endpoints. */
|
|
286
|
+
export declare function lerp(a: number, b: number, t: number): number;
|
|
287
|
+
/** Clamp to the 0..1 range every beat field and progress helper works in. */
|
|
288
|
+
export declare function clamp01(n: number): number;
|
|
289
|
+
type LinearScale = ScaleLinear<number, number>;
|
|
290
|
+
/** Left to right scale across the stage. */
|
|
291
|
+
export declare function xScale(domain: [number, number], range: [number, number]): LinearScale;
|
|
292
|
+
/** Top down scale: pass the range already inverted (bottom first). */
|
|
293
|
+
export declare function yScale(domain: [number, number], range: [number, number]): LinearScale;
|
|
294
|
+
/**
|
|
295
|
+
* Progress of item `i` of `n` when one 0..1 beat field is staggered by `step` per item: each
|
|
296
|
+
* item starts `step` after the one before it, and the last one still lands at 1.
|
|
297
|
+
*/
|
|
298
|
+
export declare function stagger(progress: number, i: number, n: number, step: number): number;
|
|
299
|
+
interface EndLabel {
|
|
300
|
+
/** Preferred vertical centre, in viewBox units. */
|
|
301
|
+
y: number;
|
|
302
|
+
/** Label height, in viewBox units. */
|
|
303
|
+
h: number;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Nudge overlapping end labels apart, keeping their vertical order.
|
|
307
|
+
*
|
|
308
|
+
* Returns resolved centres in the input order. Pure: no clamping to the stage,
|
|
309
|
+
* because a caller that cares about the frame edge will shift the whole block.
|
|
310
|
+
*/
|
|
311
|
+
export declare function stackEndLabels(labels: EndLabel[], gap?: number): number[];
|
|
312
|
+
/** Parent timelines drive reveal: first the frame, then the crisp, unfiltered code. */
|
|
313
|
+
export declare function CodeInk({ lines, x, y, width, height, label, hue, step, labelColor, overflow, scroll, surface, reveal, fontSize, lang, href, seed }: {
|
|
314
|
+
lines: string[];
|
|
315
|
+
x: number;
|
|
316
|
+
y: number;
|
|
317
|
+
width: number;
|
|
318
|
+
height: number;
|
|
319
|
+
label?: string;
|
|
320
|
+
hue?: Hue;
|
|
321
|
+
step?: InkStep;
|
|
322
|
+
labelColor?: string;
|
|
323
|
+
overflow?: boolean;
|
|
324
|
+
scroll?: boolean;
|
|
325
|
+
surface?: boolean;
|
|
326
|
+
reveal?: number;
|
|
327
|
+
fontSize?: number;
|
|
328
|
+
lang?: "sql";
|
|
329
|
+
href?: string;
|
|
330
|
+
seed?: string;
|
|
331
|
+
}): import("react").JSX.Element;
|
|
332
|
+
/**
|
|
333
|
+
* A small SQL tokenizer, for highlighting the query CodeInk draws.
|
|
334
|
+
*
|
|
335
|
+
* Slidev ships shiki, but shiki highlights asynchronously and returns HTML,
|
|
336
|
+
* and CodeInk's whole aesthetic is that the code is typeset text inside a
|
|
337
|
+
* drawn frame rather than injected markup. The deck shows four lines of SQL,
|
|
338
|
+
* so a synchronous tokenizer over three token kinds is the smaller thing that
|
|
339
|
+
* works, and it renders identically on every load and in the PDF export.
|
|
340
|
+
*
|
|
341
|
+
* Every character of the input survives into exactly one token, so joining a
|
|
342
|
+
* line's token text reproduces the line.
|
|
343
|
+
*/
|
|
344
|
+
type SqlTokenKind = "keyword" | "literal" | "plain";
|
|
345
|
+
interface SqlToken {
|
|
346
|
+
text: string;
|
|
347
|
+
kind: SqlTokenKind;
|
|
348
|
+
}
|
|
349
|
+
export declare function tokenizeSql(line: string): SqlToken[];
|
|
350
|
+
export declare function Graph3D({ nodes, edges, orbit, dim, zoom, spec, legend }: {
|
|
351
|
+
nodes: {
|
|
352
|
+
id: string;
|
|
353
|
+
label?: string;
|
|
354
|
+
category?: string;
|
|
355
|
+
}[];
|
|
356
|
+
edges: {
|
|
357
|
+
source: string;
|
|
358
|
+
target: string;
|
|
359
|
+
confidence?: number;
|
|
360
|
+
}[];
|
|
361
|
+
orbit?: boolean;
|
|
362
|
+
dim?: number;
|
|
363
|
+
zoom?: number;
|
|
364
|
+
spec?: Record<string, unknown>;
|
|
365
|
+
legend?: GraphProps["legend"];
|
|
366
|
+
}): import("react").JSX.Element;
|
|
367
|
+
interface GrowHandle {
|
|
368
|
+
addGrow(tl: gsap.core.Timeline, position?: gsap.Position): gsap.core.Timeline;
|
|
369
|
+
}
|
|
370
|
+
export declare function InkNumber({ value, label, hue, step, size, count, prefix, suffix, ref }: {
|
|
371
|
+
value: string;
|
|
372
|
+
label?: string;
|
|
373
|
+
hue?: Hue;
|
|
374
|
+
step?: InkStep;
|
|
375
|
+
size?: number;
|
|
376
|
+
count?: boolean;
|
|
377
|
+
prefix?: string;
|
|
378
|
+
suffix?: string;
|
|
379
|
+
ref?: Ref<GrowHandle>;
|
|
380
|
+
}): import("react").JSX.Element;
|
|
381
|
+
interface InkBarRow {
|
|
382
|
+
id: string;
|
|
383
|
+
label: string;
|
|
384
|
+
value: number;
|
|
385
|
+
text?: string;
|
|
386
|
+
hue?: Hue;
|
|
387
|
+
step?: InkStep;
|
|
388
|
+
}
|
|
389
|
+
/** Append to caller-owned timelines managed by useStage or useTimeline. */
|
|
390
|
+
interface RowState {
|
|
391
|
+
y: number;
|
|
392
|
+
len: number;
|
|
393
|
+
reveal: number;
|
|
394
|
+
opacity: number;
|
|
395
|
+
accent: number;
|
|
396
|
+
label: string;
|
|
397
|
+
text: string;
|
|
398
|
+
accentColor: string;
|
|
399
|
+
base: string;
|
|
400
|
+
}
|
|
401
|
+
interface BarsHandle extends GrowHandle {
|
|
402
|
+
readonly labelLeft: number;
|
|
403
|
+
readonly state: Record<string, RowState>;
|
|
404
|
+
addGrow(tl: gsap.core.Timeline, at?: gsap.Position, opts?: {
|
|
405
|
+
spread?: number;
|
|
406
|
+
}): gsap.core.Timeline;
|
|
407
|
+
addReorder(tl: gsap.core.Timeline, next: InkBarRow[], domain?: [number, number], at?: gsap.Position, opts?: {
|
|
408
|
+
spread?: number;
|
|
409
|
+
}): gsap.core.Timeline;
|
|
410
|
+
addExit(tl: gsap.core.Timeline, ids: string[], at?: gsap.Position): gsap.core.Timeline;
|
|
411
|
+
addRecolor(tl: gsap.core.Timeline, id: string, color: string, at?: gsap.Position): gsap.core.Timeline;
|
|
412
|
+
}
|
|
413
|
+
export declare function InkBars({ rows, domain, xRange, yBand, thickness, sort, labelWidth, labelGap, format, hue, step, seed, ref }: {
|
|
414
|
+
rows: InkBarRow[];
|
|
415
|
+
domain: [number, number];
|
|
416
|
+
xRange: [number, number];
|
|
417
|
+
yBand: [number, number];
|
|
418
|
+
thickness?: number;
|
|
419
|
+
sort?: "none" | "asc" | "desc";
|
|
420
|
+
labelWidth?: number;
|
|
421
|
+
labelGap?: number;
|
|
422
|
+
format?: (value: number) => string;
|
|
423
|
+
hue?: Hue;
|
|
424
|
+
step?: InkStep;
|
|
425
|
+
seed?: string;
|
|
426
|
+
ref?: Ref<BarsHandle>;
|
|
427
|
+
}): import("react").JSX.Element;
|
|
428
|
+
export declare function InkCardRect({ x, y, width, height, radius, surface, hue, glowCx, glowCy, glowR, glowEdge, glowOpacity, lit, stroke, strokeWidth, strokeOpacity, dash, glowFilter, children }: {
|
|
429
|
+
x: number;
|
|
430
|
+
y: number;
|
|
431
|
+
width: number;
|
|
432
|
+
height: number;
|
|
433
|
+
radius?: number;
|
|
434
|
+
surface?: string;
|
|
435
|
+
hue?: Hue;
|
|
436
|
+
glowCx?: number;
|
|
437
|
+
glowCy?: number;
|
|
438
|
+
glowR?: number;
|
|
439
|
+
glowEdge?: number;
|
|
440
|
+
glowOpacity?: number;
|
|
441
|
+
lit?: boolean;
|
|
442
|
+
stroke?: string;
|
|
443
|
+
strokeWidth?: number;
|
|
444
|
+
strokeOpacity?: number;
|
|
445
|
+
dash?: string;
|
|
446
|
+
glowFilter?: boolean;
|
|
447
|
+
children?: ReactNode;
|
|
448
|
+
}): import("react").JSX.Element;
|
|
449
|
+
export declare function InkChip({ x, y, text, hue, anchor, progress, href, wide }: {
|
|
450
|
+
x: number;
|
|
451
|
+
y: number;
|
|
452
|
+
text: string;
|
|
453
|
+
hue?: Hue;
|
|
454
|
+
anchor?: "left" | "right";
|
|
455
|
+
progress?: number;
|
|
456
|
+
href?: string;
|
|
457
|
+
wide?: boolean;
|
|
458
|
+
}): import("react").JSX.Element;
|
|
459
|
+
interface DrawOptions {
|
|
460
|
+
duration?: number;
|
|
461
|
+
ease?: string;
|
|
462
|
+
}
|
|
463
|
+
/** Append to caller-owned timelines managed by useStage or useTimeline. */
|
|
464
|
+
interface LineHandle {
|
|
465
|
+
readonly root: SVGGElement | null;
|
|
466
|
+
addDraw(tl: gsap.core.Timeline, position?: gsap.Position, opts?: DrawOptions): gsap.core.Timeline;
|
|
467
|
+
addErase(tl: gsap.core.Timeline, position?: gsap.Position): gsap.core.Timeline;
|
|
468
|
+
settle(): void;
|
|
469
|
+
}
|
|
470
|
+
export declare function InkLine({ series, xDomain, yDomain, xRange, yRange, interp, hue, step, reveal, ghost, color, seed, width, dots, head, ref }: {
|
|
471
|
+
series: Point[];
|
|
472
|
+
xDomain: [number, number];
|
|
473
|
+
yDomain: [number, number];
|
|
474
|
+
xRange: [number, number];
|
|
475
|
+
yRange: [number, number];
|
|
476
|
+
interp?: "linear" | "step";
|
|
477
|
+
hue?: Hue;
|
|
478
|
+
step?: InkStep;
|
|
479
|
+
reveal?: number;
|
|
480
|
+
ghost?: boolean | number;
|
|
481
|
+
color?: string;
|
|
482
|
+
seed?: string;
|
|
483
|
+
width?: number;
|
|
484
|
+
dots?: boolean;
|
|
485
|
+
head?: boolean;
|
|
486
|
+
ref?: Ref<LineHandle>;
|
|
487
|
+
}): import("react").JSX.Element;
|
|
488
|
+
/** A one-shot focus ring driven by its parent's progress. Both endpoints are invisible. */
|
|
489
|
+
export declare function InkPing({ x, y, r, width, height, rx, hue, step, color, progress, beacon }: {
|
|
490
|
+
x: number;
|
|
491
|
+
y: number;
|
|
492
|
+
r?: number;
|
|
493
|
+
width?: number;
|
|
494
|
+
height?: number;
|
|
495
|
+
rx?: number;
|
|
496
|
+
hue?: Hue;
|
|
497
|
+
step?: InkStep;
|
|
498
|
+
color?: string;
|
|
499
|
+
progress?: number;
|
|
500
|
+
beacon?: boolean;
|
|
501
|
+
}): import("react").JSX.Element[] | null;
|
|
502
|
+
interface RuleHandle {
|
|
503
|
+
readonly root: SVGGElement | null;
|
|
504
|
+
addDraw(tl: gsap.core.Timeline, position?: gsap.Position): gsap.core.Timeline;
|
|
505
|
+
}
|
|
506
|
+
export declare function InkRule({ x1, x2, y, hue, step, width, seed, opacity, ref }: {
|
|
507
|
+
x1: number;
|
|
508
|
+
x2: number;
|
|
509
|
+
y: number;
|
|
510
|
+
hue?: Hue;
|
|
511
|
+
step?: InkStep;
|
|
512
|
+
width?: number;
|
|
513
|
+
seed?: string;
|
|
514
|
+
opacity?: number;
|
|
515
|
+
ref?: Ref<RuleHandle>;
|
|
516
|
+
}): import("react").JSX.Element;
|
|
517
|
+
type InkStyle = "clean" | "marker";
|
|
518
|
+
export declare const STORY_STYLE: {
|
|
519
|
+
ink: InkStyle;
|
|
520
|
+
};
|
|
521
|
+
export declare function inkStyle(): InkStyle;
|
|
522
|
+
/** Stroke widths in viewBox units of the 1920x1080 stage. */
|
|
523
|
+
export declare const STROKE: {
|
|
524
|
+
/** A data series. */
|
|
525
|
+
readonly line: 3.5;
|
|
526
|
+
/** A hairline axis or baseline. */
|
|
527
|
+
readonly rule: 1.5;
|
|
528
|
+
/** An annotation tick. */
|
|
529
|
+
readonly tick: 4;
|
|
530
|
+
/** A faint background stroke. */
|
|
531
|
+
readonly faint: 2;
|
|
532
|
+
};
|
|
533
|
+
/** `M x y L x y ...` for a polyline, rounded to centipixels. */
|
|
534
|
+
export declare function polylinePath(points: Point[]): string;
|
|
535
|
+
interface TimelineTick {
|
|
536
|
+
id: string;
|
|
537
|
+
at: number;
|
|
538
|
+
label: string;
|
|
539
|
+
bright?: boolean;
|
|
540
|
+
projected?: boolean;
|
|
541
|
+
}
|
|
542
|
+
interface TickState {
|
|
543
|
+
ink: number;
|
|
544
|
+
lift: number;
|
|
545
|
+
}
|
|
546
|
+
/** Append to caller-owned timelines managed by useStage or useTimeline. */
|
|
547
|
+
interface TimelineHandle {
|
|
548
|
+
readonly state: TickState[];
|
|
549
|
+
addInk(tl: gsap.core.Timeline, position?: gsap.Position): gsap.core.Timeline;
|
|
550
|
+
addLift(tl: gsap.core.Timeline, id: string, position?: gsap.Position): gsap.core.Timeline;
|
|
551
|
+
tickX(id: string): number;
|
|
552
|
+
}
|
|
553
|
+
export declare function InkTimeline({ ticks, domain, range, y, hue, step, brightStep, tickHeight, tickWidth, labelGap, labelOffset, rowHeight, labelSize, labelRows, state, ref }: {
|
|
554
|
+
ticks: TimelineTick[];
|
|
555
|
+
domain: [number, number];
|
|
556
|
+
range: [number, number];
|
|
557
|
+
y: number;
|
|
558
|
+
hue?: Hue;
|
|
559
|
+
step?: InkStep;
|
|
560
|
+
brightStep?: InkStep;
|
|
561
|
+
tickHeight?: number;
|
|
562
|
+
tickWidth?: number;
|
|
563
|
+
labelGap?: number;
|
|
564
|
+
labelOffset?: number;
|
|
565
|
+
rowHeight?: number;
|
|
566
|
+
labelSize?: number;
|
|
567
|
+
labelRows?: number;
|
|
568
|
+
state?: TickState[];
|
|
569
|
+
ref?: Ref<TimelineHandle>;
|
|
570
|
+
}): import("react").JSX.Element;
|
|
571
|
+
export declare function InkTimelineCursor({ position, domain, range, y, hue }: {
|
|
572
|
+
position: number;
|
|
573
|
+
domain: [number, number];
|
|
574
|
+
range: [number, number];
|
|
575
|
+
y: number;
|
|
576
|
+
hue: Hue;
|
|
577
|
+
}): import("react").JSX.Element;
|
|
578
|
+
export declare function OpenChart({ spec, onMarkHover, onMarkLeave }: {
|
|
579
|
+
spec: ChartSpec | LayerSpec;
|
|
580
|
+
onMarkHover?: (event: MarkEvent) => void;
|
|
581
|
+
onMarkLeave?: () => void;
|
|
582
|
+
}): import("react").JSX.Element;
|
|
583
|
+
/** The mark follows the typeset word, including font loading and frame resizing. */
|
|
584
|
+
export declare function Underline({ children, hue, step, thickness }: {
|
|
585
|
+
children: ReactNode;
|
|
586
|
+
hue?: Hue;
|
|
587
|
+
step?: InkStep;
|
|
588
|
+
thickness?: number;
|
|
589
|
+
}): import("react").JSX.Element;
|
|
590
|
+
interface UnitGridHandle {
|
|
591
|
+
/** Cells that have entered the collapse target box. */
|
|
592
|
+
readonly arrived: number;
|
|
593
|
+
}
|
|
594
|
+
/** A prop-driven waffle. The stage owns the reveal, recolor and gather timelines. */
|
|
595
|
+
export declare function UnitGrid({ items, count, glyph, cols, cellWidth, cellHeight, gapX, gapY, origin, color, colorBy, seed, reveal, stagger, recolor, scatter, collapse, collapseTo, collapseStagger, collapseInto, glow, filterId, ref }: {
|
|
596
|
+
items?: UnitGridItem[];
|
|
597
|
+
count?: number;
|
|
598
|
+
glyph?: "square" | "sheet";
|
|
599
|
+
cols?: number;
|
|
600
|
+
cellWidth?: number;
|
|
601
|
+
cellHeight?: number;
|
|
602
|
+
gapX?: number;
|
|
603
|
+
gapY?: number;
|
|
604
|
+
origin?: Point;
|
|
605
|
+
color?: string;
|
|
606
|
+
colorBy?: string | ((item: UnitGridItem, index: number) => string | undefined);
|
|
607
|
+
seed?: string;
|
|
608
|
+
reveal?: number;
|
|
609
|
+
stagger?: number;
|
|
610
|
+
recolor?: number;
|
|
611
|
+
scatter?: number;
|
|
612
|
+
collapse?: number;
|
|
613
|
+
collapseTo?: Point;
|
|
614
|
+
collapseStagger?: number;
|
|
615
|
+
collapseInto?: {
|
|
616
|
+
width: number;
|
|
617
|
+
height: number;
|
|
618
|
+
};
|
|
619
|
+
glow?: boolean;
|
|
620
|
+
filterId?: string;
|
|
621
|
+
ref?: Ref<UnitGridHandle>;
|
|
622
|
+
}): import("react").JSX.Element;
|
|
623
|
+
/** Build after child refs exist; entrance and beats share that mount order. */
|
|
624
|
+
export declare function useStageEntrance(build: (tl: gsap.core.Timeline) => void, opts?: {
|
|
625
|
+
beats?: (tl: gsap.core.Timeline, beat: (n: number) => void) => void;
|
|
626
|
+
}): void;
|
|
627
|
+
export declare function useScriptedDemo(): {
|
|
628
|
+
clicks: number;
|
|
629
|
+
isActive: boolean;
|
|
630
|
+
playCount: number;
|
|
631
|
+
shown: (at: number) => boolean;
|
|
632
|
+
};
|
|
633
|
+
export declare function useStage<C extends {
|
|
634
|
+
lead: string;
|
|
635
|
+
body?: string;
|
|
636
|
+
}>({ copy, enter, beats }: {
|
|
637
|
+
copy: readonly C[];
|
|
638
|
+
enter?: (tl: gsap.core.Timeline) => void;
|
|
639
|
+
beats: (tl: gsap.core.Timeline, beat: (n: number) => void) => void;
|
|
640
|
+
}): {
|
|
641
|
+
clicks: number;
|
|
642
|
+
isActive: boolean;
|
|
643
|
+
playCount: number;
|
|
644
|
+
shown: (at: number) => boolean;
|
|
645
|
+
copy: C;
|
|
646
|
+
beats: number;
|
|
647
|
+
};
|
|
648
|
+
/**
|
|
649
|
+
* useStageMap: the mapping between stage units and the overlay.
|
|
650
|
+
*
|
|
651
|
+
* Both live in `.od-story-frame`, the largest 16:9 box that fits the viewport
|
|
652
|
+
* (story-frame.css), and the stage svg's viewBox is 16:9 too, so the mapping is a
|
|
653
|
+
* fixed ratio: x percent of the frame's width is always viewBox x * 1920/100.
|
|
654
|
+
* It used to depend on the window, because the frame was the whole viewport
|
|
655
|
+
* and `xMidYMid slice` cropped the ink by however far the window was from
|
|
656
|
+
* 16:9; the frame removed the crop and with it the window dependency.
|
|
657
|
+
*
|
|
658
|
+
* The functions stay because the two spaces still use different numbers, and
|
|
659
|
+
* an overlay element that has to sit on an svg mark should say so at the call
|
|
660
|
+
* site rather than open-coding a division by 19.2.
|
|
661
|
+
*/
|
|
662
|
+
interface StagePoint {
|
|
663
|
+
x: number;
|
|
664
|
+
y: number;
|
|
665
|
+
}
|
|
666
|
+
/** A box in overlay percentages, the shape `left/top/width/height: %` styles take. */
|
|
667
|
+
interface PctBox {
|
|
668
|
+
left: number;
|
|
669
|
+
top: number;
|
|
670
|
+
width: number;
|
|
671
|
+
height: number;
|
|
672
|
+
}
|
|
673
|
+
export declare function useStageMap(): {
|
|
674
|
+
toPctBox: (x: number, y: number, w: number, h: number) => PctBox;
|
|
675
|
+
toStageCenter: (box: PctBox) => StagePoint;
|
|
676
|
+
toStageSize: (box: PctBox) => {
|
|
677
|
+
width: number;
|
|
678
|
+
height: number;
|
|
679
|
+
};
|
|
680
|
+
};
|
|
681
|
+
export declare function StoryCard({ lead, leadContent, body, anchor, hue, className, style }: {
|
|
682
|
+
lead: string;
|
|
683
|
+
leadContent?: ReactNode;
|
|
684
|
+
body?: string;
|
|
685
|
+
anchor?: "left" | "right";
|
|
686
|
+
hue?: Hue;
|
|
687
|
+
className?: string;
|
|
688
|
+
style?: CSSProperties;
|
|
689
|
+
}): import("react").JSX.Element;
|
|
690
|
+
export declare function StoryCover({ field, head, title, lede, byline, eyebrow, aside, background, center, url, brand, enterAfterTransition, children }: {
|
|
691
|
+
field?: ReactNode;
|
|
692
|
+
head?: ReactNode;
|
|
693
|
+
title?: ReactNode;
|
|
694
|
+
lede?: ReactNode;
|
|
695
|
+
byline?: ReactNode;
|
|
696
|
+
eyebrow?: ReactNode;
|
|
697
|
+
aside?: ReactNode;
|
|
698
|
+
background?: ReactNode;
|
|
699
|
+
center?: boolean;
|
|
700
|
+
url?: string;
|
|
701
|
+
brand?: boolean;
|
|
702
|
+
enterAfterTransition?: boolean;
|
|
703
|
+
children?: ReactNode;
|
|
704
|
+
}): import("react").JSX.Element;
|
|
705
|
+
export declare function StoryLayer({ children, className }: {
|
|
706
|
+
children: ReactNode;
|
|
707
|
+
className?: string;
|
|
708
|
+
}): import("react").JSX.Element;
|
|
709
|
+
export declare function StoryLink({ href, label, opacity }: {
|
|
710
|
+
href: string;
|
|
711
|
+
label?: string;
|
|
712
|
+
opacity?: number;
|
|
713
|
+
}): import("react").JSX.Element;
|
|
714
|
+
/** How far a piece of chrome travels while it fades in, in px. */
|
|
715
|
+
export declare const RISE: {
|
|
716
|
+
readonly card: 6;
|
|
717
|
+
readonly enter: 14;
|
|
718
|
+
};
|
|
719
|
+
/**
|
|
720
|
+
* Enter callback: fade in with a short rise. Under instant motion it settles
|
|
721
|
+
* immediately.
|
|
722
|
+
*/
|
|
723
|
+
export declare function riseIn(el: Element, done: () => void): void;
|
|
724
|
+
/**
|
|
725
|
+
* Enter callback: fade in place over the card beat, no travel. Pairs with
|
|
726
|
+
* `fadeOutInPlace` for a label that swaps on a beat (a timeline date, a map
|
|
727
|
+
* legend), which should cross fade on the card's clock without the card's
|
|
728
|
+
* rise.
|
|
729
|
+
*/
|
|
730
|
+
export declare function fadeIn(el: Element, done: () => void): void;
|
|
731
|
+
/**
|
|
732
|
+
* Ease a box from a measured height to its natural height over the card beat.
|
|
733
|
+
*
|
|
734
|
+
* For a container whose content is swapped by `riseIn`/`fadeOutInPlace`: the
|
|
735
|
+
* outgoing copy leaves the flow, so without this the box would resize to the
|
|
736
|
+
* incoming copy in one frame. Call it from the enter callback with the height
|
|
737
|
+
* recorded in before leaving. Any height tween still running on the box is
|
|
738
|
+
* killed first, so fast clicking never stacks two. Under reduced motion the
|
|
739
|
+
* box takes its new height at once.
|
|
740
|
+
*/
|
|
741
|
+
export declare function easeHeight(el: HTMLElement, from: number): void;
|
|
742
|
+
/**
|
|
743
|
+
* Leave callback for a swapped card body: take the outgoing copy out of
|
|
744
|
+
* flow so the two states overlap rather than collapsing the card height mid
|
|
745
|
+
* swap, then fade it without moving it. Only the incoming copy travels.
|
|
746
|
+
*/
|
|
747
|
+
export declare function fadeOutInPlace(el: Element, done: () => void): void;
|
|
748
|
+
interface EntranceOptions {
|
|
749
|
+
/** Ordered groups of elements; each group starts one stagger after the last. */
|
|
750
|
+
groups: Element[][];
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* Slide entrance: each group fades in and settles up over the morph
|
|
754
|
+
* duration, starting one `opacity` beat after the previous group. Returns
|
|
755
|
+
* the timeline so the caller can kill it on re-entry or unmount.
|
|
756
|
+
*/
|
|
757
|
+
export declare function entrance(opts: EntranceOptions): gsap.core.Timeline;
|
|
758
|
+
export declare const STAGE: {
|
|
759
|
+
readonly width: 1920;
|
|
760
|
+
readonly height: 1080;
|
|
761
|
+
};
|
|
762
|
+
export declare function StoryStage({ beats, click, stage, overlay, card, background, fluid, enterAfterTransition, className }: {
|
|
763
|
+
beats?: number;
|
|
764
|
+
click?: number;
|
|
765
|
+
stage?: ReactNode;
|
|
766
|
+
overlay?: ReactNode;
|
|
767
|
+
card?: ReactNode;
|
|
768
|
+
background?: ReactNode;
|
|
769
|
+
fluid?: boolean;
|
|
770
|
+
enterAfterTransition?: boolean;
|
|
771
|
+
className?: string;
|
|
772
|
+
}): import("react").JSX.Element;
|
|
773
|
+
/** Resolve once before inserting a group so relative positions do not stagger it. */
|
|
774
|
+
export declare function resolvePosition(tl: gsap.core.Timeline, position: gsap.Position | undefined): number;
|
|
775
|
+
/** Includes the deck's explicit instant mode as well as the system preference. */
|
|
776
|
+
export declare function prefersReducedMotion(): boolean;
|
|
777
|
+
export declare const slideChartTheme: {
|
|
778
|
+
readonly colors: {
|
|
779
|
+
background: string;
|
|
780
|
+
text: string;
|
|
781
|
+
gridline: string;
|
|
782
|
+
axis: string;
|
|
783
|
+
};
|
|
784
|
+
readonly fonts: {
|
|
785
|
+
family: string;
|
|
786
|
+
mono: string;
|
|
787
|
+
sizes: {
|
|
788
|
+
title: number;
|
|
789
|
+
subtitle: number;
|
|
790
|
+
body: number;
|
|
791
|
+
small: number;
|
|
792
|
+
axisTick: number;
|
|
793
|
+
metricLabel: number;
|
|
794
|
+
metricValue: number;
|
|
795
|
+
};
|
|
796
|
+
};
|
|
797
|
+
spacing: {
|
|
798
|
+
xAxisHeight: number;
|
|
799
|
+
xAxisLabelPadding: number;
|
|
800
|
+
};
|
|
801
|
+
readonly chrome: {
|
|
802
|
+
eyebrow: {
|
|
803
|
+
color: string;
|
|
804
|
+
};
|
|
805
|
+
title: {
|
|
806
|
+
color: string;
|
|
807
|
+
};
|
|
808
|
+
subtitle: {
|
|
809
|
+
color: string;
|
|
810
|
+
};
|
|
811
|
+
source: {
|
|
812
|
+
color: string;
|
|
813
|
+
};
|
|
814
|
+
byline: {
|
|
815
|
+
color: string;
|
|
816
|
+
};
|
|
817
|
+
};
|
|
818
|
+
};
|
|
819
|
+
export declare function scaleChartTheme<T extends {
|
|
820
|
+
fonts: {
|
|
821
|
+
sizes: Record<string, number>;
|
|
822
|
+
};
|
|
823
|
+
spacing: {
|
|
824
|
+
xAxisHeight: number;
|
|
825
|
+
xAxisLabelPadding: number;
|
|
826
|
+
};
|
|
827
|
+
}>(value: T, scale: number): T;
|
|
828
|
+
export declare const slideChartAnimation: {
|
|
829
|
+
readonly enter: {
|
|
830
|
+
readonly duration: 900;
|
|
831
|
+
readonly ease: "smooth";
|
|
832
|
+
};
|
|
833
|
+
readonly annotationDelay: 350;
|
|
834
|
+
};
|
|
835
|
+
export declare const SETTLE = "odSettle";
|
|
836
|
+
export declare const DRAW = "odDraw";
|
|
837
|
+
export declare const TRACE = "odTrace";
|
|
838
|
+
/** The same curves as CSS strings, for transitions that stay in CSS. */
|
|
839
|
+
export declare const SETTLE_CSS = "cubic-bezier(.32,.72,0,1)";
|
|
840
|
+
export declare const DRAW_CSS = "cubic-bezier(.65,0,.35,1)";
|
|
841
|
+
export declare const TRACE_CSS = "cubic-bezier(.62,.02,.18,1)";
|
|
842
|
+
/** Durations in seconds. Every tween on a story slide reads one of these. */
|
|
843
|
+
export declare const DUR: {
|
|
844
|
+
/** One step of a progressive append, such as a fan chart sample path. */
|
|
845
|
+
readonly tick: 0.03;
|
|
846
|
+
readonly opacity: 0.14;
|
|
847
|
+
readonly draw: 0.24;
|
|
848
|
+
readonly card: 0.3;
|
|
849
|
+
readonly color: 0.34;
|
|
850
|
+
readonly eraseDelay: 0.35;
|
|
851
|
+
readonly eraseHold: 0.49;
|
|
852
|
+
readonly grow: 0.56;
|
|
853
|
+
readonly morph: 0.6;
|
|
854
|
+
readonly scale: 0.9;
|
|
855
|
+
/** A field gathering into one card, sheet by sheet. */
|
|
856
|
+
readonly gather: 1.6;
|
|
857
|
+
/** The cover's hero line, traced end to end. */
|
|
858
|
+
readonly trace: 1.8;
|
|
859
|
+
readonly bloom: 2.4;
|
|
860
|
+
};
|
|
861
|
+
/**
|
|
862
|
+
* The start offset, in seconds, of item `i` of `n` when a group of tweens is
|
|
863
|
+
* spread across `spread` seconds. The offsets follow an ease-in-out curve: the
|
|
864
|
+
* first few leave close together, the middle flows and the last few settle, so
|
|
865
|
+
* a cascade reads as one gesture rather than a metronome of even steps.
|
|
866
|
+
*/
|
|
867
|
+
export declare function easedStagger(i: number, n: number, spread: number): number;
|
|
868
|
+
export declare const FILTER_IDS: {
|
|
869
|
+
readonly marker: "mk-marker";
|
|
870
|
+
readonly markerLite: "mk-marker-lite";
|
|
871
|
+
readonly dry: "mk-dry";
|
|
872
|
+
readonly dryLite: "mk-dry-lite";
|
|
873
|
+
readonly rule: "mk-rule";
|
|
874
|
+
readonly ruleLite: "mk-rule-lite";
|
|
875
|
+
/** Soft same hue glow for clean strokes. Not a marker filter. */
|
|
876
|
+
readonly glow: "mk-glow";
|
|
877
|
+
};
|
|
878
|
+
/** `url(#id)` for the filter attribute. */
|
|
879
|
+
export declare function filterUrl(id: string): string;
|
|
880
|
+
export { type BarsHandle, type Dab, type DrawOptions, type GrowHandle, type Hue, type InkBarRow, type InkOpts, type InkStep, type LineHandle, type Point, type RippleOptions, type RuleHandle, type Series, type Theme, type TickState, type TimelineHandle, type TimelineTick, type UnitGridGeometry, type UnitGridHandle, type UnitGridItem, gsap$1 as gsap, parliament_d_exports as parliament, useSlideScale as useFrameScale };
|