waygraph 0.15.25 → 0.15.26

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.
@@ -0,0 +1,536 @@
1
+ import type { Checkpoint } from "../types.js";
2
+ import type { MemPage } from "../mem-page.js";
3
+ /** Shared dwell fields on stubs, fixtures, and yap slides. */
4
+ export type FixtureDurationFields = {
5
+ /**
6
+ * Min time this fixture stays visible before the demo advances.
7
+ * - `true` - defaults (2000ms normal, {@link FixtureDurationFields.fastMode} or 600ms when --fast)
8
+ * - `number` - override normal dwell ms
9
+ * - omit / false - no authored dwell (caller keeps legacy timing)
10
+ */
11
+ duration?: boolean | number;
12
+ /**
13
+ * Dwell ms when demo `--fast` / gatesFast (only when {@link duration} is set).
14
+ * Default 600.
15
+ */
16
+ fastMode?: number;
17
+ };
18
+ /**
19
+ * One checklist row for episode planning (demo panel).
20
+ * Set via {@link StubCtx.todos} / {@link StubCtx.todoIndex} inside the lifecycle.
21
+ */
22
+ export type WaygraphTodoItem = {
23
+ text: string;
24
+ /**
25
+ * Stable id for external asserts / redirects (Mailhog, deep links).
26
+ * Stamped as `data-wg-todo-item` on the row.
27
+ */
28
+ id?: string;
29
+ /** Alias for {@link WaygraphTodoItem.id}. */
30
+ name?: string;
31
+ /** Explicit done. If omitted, derived from todoIndex (index < todoIndex). */
32
+ done?: boolean;
33
+ /** Explicit current. If omitted, derived from todoIndex (index === todoIndex). */
34
+ current?: boolean;
35
+ };
36
+ export type WaygraphTodoInput = string | WaygraphTodoItem;
37
+ /**
38
+ * Dock list presentation:
39
+ * - `sequential` - arrow on current, strike done (demo walkthrough)
40
+ * - `checklist` - checkbox done/pending only (no current arrow; independent checks)
41
+ * - `bullets` - flat bullet list (no arrow/checkbox; open notes / trimmed dock)
42
+ */
43
+ export type TodoListStyle = "sequential" | "checklist" | "bullets";
44
+ /** One titled group in the floating todo dock (FR / Scenarios / ACs, etc.). */
45
+ export type WaygraphTodoGroupInput = {
46
+ /** Stable group id -> `data-wg-todo-group`. */
47
+ id?: string;
48
+ /** Alias for {@link WaygraphTodoGroupInput.id}. */
49
+ name?: string;
50
+ /** Group heading shown above the items. */
51
+ title?: string;
52
+ /** Per-group style; falls back to dock default ({@link StubCtx.todoStyle}). */
53
+ style?: TodoListStyle;
54
+ items: readonly WaygraphTodoInput[];
55
+ /** Sequential only: which item is current (0-based). */
56
+ todoIndex?: number;
57
+ };
58
+ export type WaygraphTodoGroup = {
59
+ id?: string;
60
+ title?: string;
61
+ style: TodoListStyle;
62
+ items: WaygraphTodoItem[];
63
+ };
64
+ /** Full floating dock payload passed to the browser. */
65
+ export type TodoDockState = {
66
+ /**
67
+ * Stable dock id for external targeting after redirects
68
+ * (`#wg-todo-dock[data-wg-todo-id="…"]`).
69
+ */
70
+ id?: string;
71
+ /** Default style for groups that omit their own. */
72
+ style: TodoListStyle;
73
+ /** Single-list title when using {@link StubCtx.todos} + {@link StubCtx.todoTitle}. */
74
+ title?: string;
75
+ groups: WaygraphTodoGroup[];
76
+ pos?: "left" | "right";
77
+ };
78
+ /** Options for compact {@link StubCtx.todos}(`id`, items, opts). */
79
+ export type WaygraphTodosOpts = {
80
+ /** Dock heading. */
81
+ title?: string;
82
+ /** Current item index (0-based). */
83
+ index?: number;
84
+ /** `sequential` | `checklist` | `bullets`. */
85
+ style?: TodoListStyle;
86
+ /** Dock side. */
87
+ pos?: "left" | "right";
88
+ /**
89
+ * Keep other docks with different ids (multi-todo). Default false —
90
+ * one checklist at a time (setting todos replaces the previous dock).
91
+ */
92
+ parallel?: boolean;
93
+ };
94
+ /**
95
+ * Floating todo-dock UX knobs (0.15.8+). Defaults are **smart on** so long
96
+ * FR/AC checklists do not bury highlight rings. Opt out per phase or globally.
97
+ *
98
+ * Defaults: `compact`, `collision`, `behindRing` = true; `cap` = 5; `expandCap` = 14.
99
+ *
100
+ * Global: `WAYGRAPH_TODO_UI=full` / `waygraph demo --todo-full` turns smart off.
101
+ * Per-knob env: `WAYGRAPH_TODO_COMPACT=0`, `WAYGRAPH_TODO_COLLISION=0`,
102
+ * `WAYGRAPH_TODO_BEHIND=0`, `WAYGRAPH_TODO_CAP`, `WAYGRAPH_TODO_EXPAND_CAP`.
103
+ */
104
+ export type TodoDockUiOpts = {
105
+ /** Fold long lists around the current row (+N more / hover). Default true. */
106
+ compact?: boolean;
107
+ /** Visible rows when compact. Default 5. */
108
+ cap?: number;
109
+ /** Visible rows on hover / pinned expand. Default 14. */
110
+ expandCap?: number;
111
+ /** Flip dock L/R when an active ring overlaps it. Default true. */
112
+ collision?: boolean;
113
+ /** Dim + lower z-index while a highlight ring is up. Default true. */
114
+ behindRing?: boolean;
115
+ };
116
+ /** Resolved todo-dock UX (all fields present). */
117
+ export type TodoDockUiResolved = {
118
+ compact: boolean;
119
+ cap: number;
120
+ expandCap: number;
121
+ collision: boolean;
122
+ behindRing: boolean;
123
+ };
124
+ /** Episode-level fixtures authored inside stubBefore/After/OnError(ctx). */
125
+ export type StubPhaseFixtures = {
126
+ todos?: readonly WaygraphTodoInput[];
127
+ /** Which todo is current (0-based). Rows before = done, after = pending. */
128
+ todoIndex?: number;
129
+ /** Heading above a single {@link StubCtx.todos} list. */
130
+ todoTitle?: string;
131
+ /**
132
+ * Stable dock id (`data-wg-todo-id`) for external redirect asserts
133
+ * (e.g. Mailhog -> back to app and still find the checklist).
134
+ */
135
+ todoId?: string;
136
+ /** `sequential` (default), `checklist`, or `bullets`. */
137
+ todoStyle?: TodoListStyle;
138
+ /** Multiple titled lists (FR / Scenarios / ACs). Wins over bare todos when set. */
139
+ todoGroups?: readonly WaygraphTodoGroupInput[];
140
+ /**
141
+ * Camera zoom (Screen Studio style) - scales the page toward the target /
142
+ * cursor. Not element CSS zoom. Typical `1.25` .. `2`.
143
+ */
144
+ zoom?: number;
145
+ /** Default zoomOut for rings (false = keep camera between rings). */
146
+ zoomOut?: boolean;
147
+ /** Top demo banner title (the purple "waygraph demo" card). */
148
+ title?: string;
149
+ /**
150
+ * Floating checklist dock side. `left` | `right`.
151
+ * Authored control (also click / WAYGRAPH_TODO_POS / --todo-left|right).
152
+ */
153
+ todoPos?: "left" | "right";
154
+ /**
155
+ * Todo-dock UX (compact / collision / behind-ring). Merged onto env defaults.
156
+ * See {@link TodoDockUiOpts}.
157
+ */
158
+ todoDockUi?: TodoDockUiOpts;
159
+ /**
160
+ * Viewport preset: `mobile` | `tablet` | `desktop` (default / clear).
161
+ * Omit on later blocks = **keep** (same persist pattern as todos).
162
+ */
163
+ device?: DevicePreset | DeviceState;
164
+ /** Explicit pixel viewport (wins over preset width/height when both set). */
165
+ viewport?: DeviceViewport;
166
+ /** Touch theater + Playwright touchscreen when true. */
167
+ touch?: boolean;
168
+ /** Portrait / landscape (swaps preset width/height). */
169
+ orientation?: DeviceOrientation;
170
+ };
171
+ /** Named viewport presets (0.13+). */
172
+ export type DevicePreset = "mobile" | "tablet" | "desktop";
173
+ /** Explicit viewport box. */
174
+ export type DeviceViewport = {
175
+ width: number;
176
+ height: number;
177
+ deviceScaleFactor?: number;
178
+ };
179
+ /**
180
+ * Carried device fixture (todo-dock shaped persist).
181
+ * Omit on a later step = keep; hideDevice/clearDevice/desktop = clear to desktop.
182
+ */
183
+ export type DeviceState = {
184
+ preset: DevicePreset;
185
+ viewport: DeviceViewport;
186
+ /** Playwright-ish: treat as mobile layout. */
187
+ isMobile: boolean;
188
+ /** Context needs hasTouch for touchscreen.tap (demo launches with hasTouch). */
189
+ hasTouch: boolean;
190
+ /** Demo gesture theater: finger cursor, tap/hold timing, prefer touchscreen. */
191
+ touchMode: boolean;
192
+ /** Viewport orientation (0.13.3+). Default derived from width/height. */
193
+ orientation?: DeviceOrientation;
194
+ };
195
+ /** Portrait (tall) or landscape (wide). */
196
+ export type DeviceOrientation = "portrait" | "landscape";
197
+ /** One named highlight slot on a block (selector + caption). */
198
+ export interface WaygraphHighlightStub extends FixtureDurationFields {
199
+ selector: string;
200
+ /** Primary caption line. */
201
+ label: string;
202
+ /** Extra caption line (ring / slide body). */
203
+ detail?: string;
204
+ /** Short badge, e.g. AC / BUG / GATE / YAP. */
205
+ tag?: string;
206
+ /**
207
+ * Demo ring color + icon:
208
+ * - `planned` purple (authored narration, default)
209
+ * - `auto` gray (engine automation / verify fallback)
210
+ * - `info` blue · `warning` yellow · `danger` red · `success` green
211
+ */
212
+ tone?: HighlightTone;
213
+ /**
214
+ * Ring padding + label font scale: `sm` | `md` (default) | `lg`.
215
+ * Aliases: small/medium/large, s/m/l.
216
+ */
217
+ size?: HighlightSize;
218
+ /**
219
+ * Label font weight: `normal` (default) | `bold`.
220
+ * Aliases: regular, strong.
221
+ */
222
+ weight?: HighlightWeight;
223
+ /**
224
+ * Camera zoom while this ring is up (Screen Studio style - page scales toward
225
+ * the target / cursor). Typical `1.25` .. `2`. Cleared when the ring hides
226
+ * unless `zoomOut: false`. Episode default: {@link StubCtx.zoom}.
227
+ */
228
+ zoom?: number;
229
+ /**
230
+ * When false, keep the camera zoomed after this ring (pan to the next target
231
+ * instead of zooming out). Default true. Phase default: {@link StubCtx.zoomOut}.
232
+ */
233
+ zoomOut?: boolean;
234
+ /**
235
+ * Spotlight: dim the rest of the page, keep this target as the focal point.
236
+ */
237
+ focus?: boolean;
238
+ /**
239
+ * Deprecated no-op. Camera auto-centers on the ring target; host mouse is
240
+ * ignored. Playwright's real mouse is driven to the centered target instead.
241
+ */
242
+ followMouse?: boolean;
243
+ /** Alias for {@link WaygraphHighlightStub.followMouse} (no-op). */
244
+ follow?: boolean;
245
+ /**
246
+ * Caption text color (CSS color). Overrides tone label color when set.
247
+ * Aliases accepted at runtime: `color`, `labelColor`, `textColor`.
248
+ */
249
+ color?: string;
250
+ /**
251
+ * Move the demo cursor to the target while this ring is up (default true
252
+ * for authored stub queues; set false to keep cursor hidden).
253
+ */
254
+ cursor?: boolean;
255
+ /**
256
+ * Optional link to a todo item id. When set, Method fill/click advances that
257
+ * todo row instead of relying on stub array index (avoids password/submit/username
258
+ * alphabetical reorder bugs).
259
+ */
260
+ todo?: string;
261
+ /** Slot key from stubBefore/After map (e.g. "username") - set by resolver. */
262
+ slotId?: string;
263
+ /**
264
+ * Pointer feel when touchMode is on (0.13+):
265
+ * - `tap` - short press via touchscreen (default in touch mode)
266
+ * - `hold` - long-press (~600ms) then release
267
+ * - `click` - mouse click even in touch mode
268
+ */
269
+ gesture?: "tap" | "hold" | "click" | "swipe";
270
+ }
271
+ /** Flow fixture patch: label required; selector optional (inherits from stub). */
272
+ export type WaygraphHighlightFixture = Partial<Pick<WaygraphHighlightStub, "selector">> & Required<Pick<WaygraphHighlightStub, "label">> & Pick<WaygraphHighlightStub, "detail" | "tag" | "tone" | "size" | "weight" | "zoom" | "zoomOut" | "focus" | "followMouse" | "follow" | "color" | "cursor" | "todo" | "gesture"> & FixtureDurationFields;
273
+ export type HighlightStubPhase = Record<string, WaygraphHighlightStub>;
274
+ /**
275
+ * Open stub lifecycle context. Authors set rings + episode fixtures freely —
276
+ * not restricted to returning a closed slot object.
277
+ *
278
+ * @example
279
+ * stubBefore: (ctx) => {
280
+ * ctx.todos(["Enter email", "Enter password", "Click Sign in"]);
281
+ * ctx.todoIndex(0);
282
+ * ctx.zoom(1.35);
283
+ * ctx.highlights({
284
+ * email: { selector: "#email", label: "Email" },
285
+ * submit: { selector: "#login-button", label: "Sign in" },
286
+ * });
287
+ * }
288
+ * // Sequential plan: bump todoIndex in a later phase / later block's stubBefore
289
+ * stubAfter: (ctx) => {
290
+ * ctx.todos(["Enter email", "Enter password", "Click Sign in"]);
291
+ * ctx.todoIndex(2);
292
+ * ctx.ring("inventory", { selector: ".inventory_list", label: "Landed" });
293
+ * }
294
+ */
295
+ export type StubCtx<Out extends Checkpoint<string> = Checkpoint<string>> = {
296
+ /**
297
+ * Live Mem for this run - same store `act`/`observe` read. Prefer this over
298
+ * closing over outer scope or inventing parallel fixture bags.
299
+ * Undefined only if the caller ran a stub phase without passing mem (tests).
300
+ */
301
+ readonly mem: MemPage | undefined;
302
+ /** Present after resolve (stubAfter). Undefined for stubBefore. */
303
+ readonly out: Out | undefined;
304
+ /** Present on stubOnError when the step threw. */
305
+ readonly error: unknown | undefined;
306
+ /** Replace named highlight rings for this phase. */
307
+ highlights(slots: HighlightStubPhase): void;
308
+ /** Set / overwrite one named ring. */
309
+ ring(id: string, stub: WaygraphHighlightStub): void;
310
+ /**
311
+ * Floating checklist. Prefer the compact form:
312
+ * ctx.todos("login", ["Enter email", "Enter password"], { title: "Sign in", index: 0 })
313
+ * Legacy: ctx.todos([...]); ctx.todoId(...); ctx.todoIndex(...); …
314
+ * Default = one dock (setting todos replaces). Pass `{ parallel: true }` to keep others.
315
+ */
316
+ todos(items: readonly WaygraphTodoInput[]): void;
317
+ todos(id: string, items: readonly WaygraphTodoInput[], opts?: WaygraphTodosOpts): void;
318
+ /** Current checklist index (bump for sequential plans). */
319
+ todoIndex(n: number): void;
320
+ /** Heading above the single {@link StubCtx.todos} list. */
321
+ todoTitle(text: string): void;
322
+ /**
323
+ * Stable dock id for external selectors after redirects
324
+ * (`#wg-todo-dock[data-wg-todo-id="ep10-coverage"]`).
325
+ */
326
+ todoId(id: string): void;
327
+ /**
328
+ * Dock presentation: `sequential` (arrow walkthrough), `checklist`
329
+ * (independent checkboxes), or `bullets` (flat • list, no progress marks).
330
+ */
331
+ todoStyle(style: TodoListStyle): void;
332
+ /**
333
+ * Multiple titled lists (e.g. Functional Requirements / Scenarios / ACs).
334
+ * Replaces a bare {@link StubCtx.todos} list when set.
335
+ */
336
+ todoGroups(groups: readonly WaygraphTodoGroupInput[]): void;
337
+ /**
338
+ * Hide the floating todo dock. Omit todos on a later block = **keep** the
339
+ * previous dock (carry forward). Only hideTodos / clearTodos / todos([]) clears it.
340
+ */
341
+ hideTodos(): void;
342
+ /** Alias for {@link StubCtx.hideTodos}. */
343
+ clearTodos(): void;
344
+ /**
345
+ * Viewport / device fixture (0.13+). `mobile` | `tablet` | `desktop`.
346
+ * Omit on later blocks = **keep** (same persist as todos). Use
347
+ * {@link StubCtx.hideDevice} / {@link StubCtx.clearDevice} to return to desktop.
348
+ */
349
+ device(preset: DevicePreset | DeviceState): void;
350
+ /** Explicit CSS-pixel viewport (implies mobile-ish unless desktop-sized). */
351
+ viewport(box: DeviceViewport): void;
352
+ /** Enable / disable touch theater + touchscreen gestures. */
353
+ touch(on?: boolean): void;
354
+ /**
355
+ * Rotate viewport to portrait or landscape (0.13.3+).
356
+ * Keeps current preset; swaps width/height. Toast + lerp like device().
357
+ */
358
+ orientation(o: DeviceOrientation): void;
359
+ /** Alias for {@link StubCtx.orientation}("landscape"). */
360
+ landscape(): void;
361
+ /** Alias for {@link StubCtx.orientation}("portrait"). */
362
+ portrait(): void;
363
+ /**
364
+ * Reset to desktop viewport and clear touch mode. Omit device on a later
365
+ * block = **keep**; only hideDevice / clearDevice / device("desktop") clears.
366
+ */
367
+ hideDevice(): void;
368
+ /** Alias for {@link StubCtx.hideDevice}. */
369
+ clearDevice(): void;
370
+ /** Default camera zoom for rings without their own zoom. */
371
+ zoom(n: number): void;
372
+ /**
373
+ * Default zoomOut for rings in this phase. `false` = keep camera between rings.
374
+ */
375
+ zoomOut(keep: boolean): void;
376
+ /** Top banner title (waygraph demo card). */
377
+ title(text: string): void;
378
+ /** Alias for {@link StubCtx.title}. */
379
+ banner(text: string): void;
380
+ /**
381
+ * Floating checklist dock side (`left` | `right`). Authors control this in
382
+ * code; click / env / --todo-left|right are fallbacks.
383
+ */
384
+ todoPos(side: "left" | "right"): void;
385
+ /**
386
+ * Todo-dock UX: compact fold, collision flip, dim-behind-ring.
387
+ * Defaults are smart-on; pass false fields to opt out for this phase.
388
+ * @example
389
+ * ctx.todoDockUi({ compact: false }); // always show full list
390
+ * ctx.todoDockFull(); // shorthand: compact+collision+behindRing off
391
+ */
392
+ todoDockUi(opts: TodoDockUiOpts): void;
393
+ /** Shorthand: full checklist, no compact/collision/behind-ring for this phase. */
394
+ todoDockFull(): void;
395
+ /** Batch-set rings + episode fixtures. */
396
+ set(partial: {
397
+ highlights?: HighlightStubPhase;
398
+ } & StubPhaseFixtures): void;
399
+ };
400
+ export type StubLifecycleFn<Out extends Checkpoint<string>> = (ctx: StubCtx<Out>) => void | HighlightStubPhase | Promise<void | HighlightStubPhase>;
401
+ /**
402
+ * Block stub authoring:
403
+ * - **preferred:** open lifecycle `stubBefore(ctx) { ctx.todos(...); ctx.ring(...) }`
404
+ * - **shorthand:** static slot map `{ email: { selector, label } }`
405
+ * - **legacy:** `(out) => slotMap` still accepted (treated as highlights only)
406
+ */
407
+ export type HighlightStubPhaseOrFn<Out extends Checkpoint<string>> = HighlightStubPhase | StubLifecycleFn<Out> | ((out: Out) => HighlightStubPhase);
408
+ /** Result of running a stub phase (rings + episode fixtures). */
409
+ export type StubPhaseResult = {
410
+ highlights: ResolvedHighlight[];
411
+ /** Flattened first-group items (compat). Prefer {@link todoDock}. */
412
+ todos: WaygraphTodoItem[];
413
+ todoIndex?: number;
414
+ todoDock?: TodoDockState;
415
+ /**
416
+ * Todo dock intent for this phase:
417
+ * - `set` - replace dock with {@link todoDock}
418
+ * - `clear` - hide dock (author called hideTodos / empty todos())
419
+ * - `keep` - author omitted todos; demo must leave previous dock alone
420
+ */
421
+ todoSync?: "set" | "clear" | "keep";
422
+ /** Todo-dock UX for this phase (when author called {@link StubCtx.todoDockUi}). */
423
+ todoDockUi?: TodoDockUiOpts;
424
+ /** Resolved device after this phase (undefined when keep with no prior). */
425
+ device?: DeviceState;
426
+ /**
427
+ * Device intent (mirror todoSync):
428
+ * - `set` - apply {@link device}
429
+ * - `clear` - reset to desktop (hideDevice / clearDevice / device desktop)
430
+ * - `keep` - author omitted device; demo must leave previous alone
431
+ */
432
+ deviceSync?: "set" | "clear" | "keep";
433
+ zoom?: number;
434
+ zoomOut?: boolean;
435
+ title?: string;
436
+ todoPos?: "left" | "right";
437
+ /** When true, keep other docks (multi-todo). Default false = replace. */
438
+ todoParallel?: boolean;
439
+ };
440
+ /**
441
+ * One yap/slide in a multi-step demo caption sequence.
442
+ * Not block lifecycle - demo pauses (Next / auto-next) between slides.
443
+ */
444
+ export interface WaygraphSlide extends FixtureDurationFields {
445
+ /** Primary caption (required). */
446
+ caption: string;
447
+ detail?: string;
448
+ tag?: string;
449
+ /** Optional ring while this slide is showing. */
450
+ selector?: string;
451
+ tone?: HighlightTone;
452
+ size?: HighlightSize;
453
+ weight?: HighlightWeight;
454
+ /** Magnify via camera (Screen Studio) while this slide is showing. */
455
+ zoom?: number;
456
+ }
457
+ /**
458
+ * Demo ring tones (iconified).
459
+ * Automation (`auto`) is gray so authored planned/info/warning/danger/success stand out.
460
+ * `orange` added for Blind Pilot's own real, direct user request: a visible
461
+ * color distinction between a real Playwright-driven action (a Block run,
462
+ * or a raw click/type/upload - `auto` gray, already meant exactly this) and
463
+ * a pure DOM inspection (`auto dom` - orange, new) - "gray is waygraph
464
+ * playwright run. orange is dom check."
465
+ */
466
+ export type HighlightTone = "planned" | "auto" | "info" | "warning" | "danger" | "success" | "orange";
467
+ /** Ring + label scale. */
468
+ export type HighlightSize = "sm" | "md" | "lg";
469
+ /** Label font weight. */
470
+ export type HighlightWeight = "normal" | "bold";
471
+ /** Optional Flow-level defaults for demo rings (episode-wide). Stub/fixture wins. */
472
+ export type HighlightStyleDefaults = {
473
+ tone?: HighlightTone;
474
+ size?: HighlightSize;
475
+ weight?: HighlightWeight;
476
+ };
477
+ /**
478
+ * Demo pacing for a Flow episode or a Block/compose group.
479
+ * - `blitz` - FF-like: skip theater + short gates (same as fastForwardComposeBlock)
480
+ * - `fast` - shorter gates, keep cursor theater (~0.33x normal)
481
+ * - `normal` - default demo pace (1x)
482
+ * - `slow` - longer autoplay + fixture dwell (~2x)
483
+ * - `number` - scale vs normal when `<= 20` (e.g. `0.5`, `1.5`, `3`);
484
+ * absolute gate/dwell ms when `> 20` (e.g. `4500`)
485
+ */
486
+ export type DemoPaceName = "blitz" | "fast" | "normal" | "slow";
487
+ export type DemoPace = DemoPaceName | number;
488
+ export type WaygraphSlidesOrFn<Out extends Checkpoint<string>> = readonly WaygraphSlide[] | ((out: Out) => readonly WaygraphSlide[]);
489
+ /** Demo stub phase names (block instruction + flow fixtures). */
490
+ export type HighlightStubPhaseName = "stubBefore" | "stubAfter" | "stubOnError";
491
+ /** Per-block fixture map attached to a Flow via {@link withHighlightFixtures}. */
492
+ export type HighlightFixtureMap = Record<string, {
493
+ stubBefore?: Record<string, WaygraphHighlightFixture>;
494
+ stubAfter?: Record<string, WaygraphHighlightFixture>;
495
+ /** Fail-path rings (demo step throw) - distinct copy from success stubAfter. */
496
+ stubOnError?: Record<string, WaygraphHighlightFixture>;
497
+ /** Override / supply multi-step yap slides for this block (demo only). */
498
+ slides?: readonly WaygraphSlide[];
499
+ }>;
500
+ /** Legacy array highlight (shimmed to stubAfter keys "0", "1", ...). */
501
+ export interface WaygraphHighlight {
502
+ selector: string;
503
+ label: string;
504
+ tone?: HighlightTone;
505
+ }
506
+ export type ResolvedHighlight = WaygraphHighlightStub;
507
+ export type StubBagState = {
508
+ highlights: HighlightStubPhase;
509
+ todos?: readonly WaygraphTodoInput[] | undefined;
510
+ todoIndex?: number | undefined;
511
+ todoTitle?: string | undefined;
512
+ todoId?: string | undefined;
513
+ todoStyle?: TodoListStyle | undefined;
514
+ todoGroups?: readonly WaygraphTodoGroupInput[] | undefined;
515
+ /** Author touched the todo dock this phase (set or clear). */
516
+ todoTouched?: boolean | undefined;
517
+ /** Author asked to hide the dock. */
518
+ hideTodos?: boolean | undefined;
519
+ /** Author touched device this phase (set or clear). */
520
+ deviceTouched?: boolean | undefined;
521
+ /** Author asked to reset to desktop. */
522
+ hideDevice?: boolean | undefined;
523
+ device?: DeviceState | undefined;
524
+ /** Touch override when set via ctx.touch() alone or with device. */
525
+ touchOverride?: boolean | undefined;
526
+ /** Orientation override when set via ctx.orientation / landscape / portrait. */
527
+ orientationOverride?: DeviceOrientation | undefined;
528
+ zoom?: number | undefined;
529
+ zoomOut?: boolean | undefined;
530
+ title?: string | undefined;
531
+ todoPos?: "left" | "right" | undefined;
532
+ /** Author patched todo-dock UX this phase. */
533
+ todoDockUi?: TodoDockUiOpts | undefined;
534
+ /** Keep sibling docks (compact todos opts.parallel). */
535
+ todoParallel?: boolean | undefined;
536
+ };
@@ -0,0 +1 @@
1
+ export {};