@particle-academy/fancy-slides 0.2.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/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode, CSSProperties } from 'react';
3
- import { f as Slide$1, m as Theme, h as SlideElement, D as Deck, c as DeckOp, e as ShapeKind, j as SlideTransition, g as SlideBackground, k as TextElement, I as ImageElement, S as ShapeElement, i as SlideLayout } from './types-B2ecrEAz.cjs';
4
- export { C as ChartElement, a as CodeElement, b as DeckActivity, E as ElementBase, d as EmbedElement, T as TableElement, l as TextStyle, n as ThemeColors, o as ThemeFonts, p as TransitionKind } from './types-B2ecrEAz.cjs';
3
+ import { h as Slide$1, o as Theme, j as SlideElement, D as Deck, d as DeckOp, g as ShapeKind, l as SlideTransition, i as SlideBackground, E as ElementAnimation, m as TextElement, I as ImageElement, S as ShapeElement, k as SlideLayout } from './types-P-9MmnGU.cjs';
4
+ export { A as AnimationEffect, a as AnimationTrigger, C as ChartElement, b as CodeElement, c as DeckActivity, e as ElementBase, f as EmbedElement, T as TableElement, n as TextStyle, p as ThemeColors, q as ThemeFonts, r as TransitionKind } from './types-P-9MmnGU.cjs';
5
5
 
6
6
  interface SlideProps {
7
7
  /** The slide to render. */
@@ -14,6 +14,13 @@ interface SlideProps {
14
14
  aspectRatio?: number;
15
15
  /** Edit mode flag — passed to element renderers + enables drag/resize affordances. */
16
16
  editing?: boolean;
17
+ /**
18
+ * Current build step (0..totalSteps). `0` = nothing built (only non-animated
19
+ * elements visible); each step reveals more animated elements. Omit (or pass
20
+ * a number ≥ total) to show the fully-built slide. Ignored when `editing` —
21
+ * the editor always shows every element so authors can position them.
22
+ */
23
+ buildStep?: number;
17
24
  /** Called when a text element's content is edited (only in editing mode). */
18
25
  onElementContentChange?: (elementId: string, content: string) => void;
19
26
  /** Called when an element is clicked — host-driven selection. */
@@ -47,7 +54,7 @@ interface SlideProps {
47
54
  * Both fire through `onElementMove` / `onElementResize` so the host owns
48
55
  * the state — Slide stays a pure renderer.
49
56
  */
50
- declare function Slide({ slide, theme, width, aspectRatio, editing, onElementContentChange, onElementSelect, selectedElementId, onElementMove, onElementResize, renderElement, className, style, }: SlideProps): react_jsx_runtime.JSX.Element;
57
+ declare function Slide({ slide, theme, width, aspectRatio, editing, buildStep, onElementContentChange, onElementSelect, selectedElementId, onElementMove, onElementResize, renderElement, className, style, }: SlideProps): react_jsx_runtime.JSX.Element;
51
58
 
52
59
  /**
53
60
  * What the surrounding <Slide> knows about itself. Exposed to children
@@ -293,6 +300,10 @@ interface ElementInspectorProps {
293
300
  onSetTransition?: (transition?: SlideTransition) => void;
294
301
  /** Set the slide's background. */
295
302
  onSetBackground?: (background?: SlideBackground) => void;
303
+ /** Set or clear the selected element's entrance build animation. */
304
+ onSetAnimation?: (animation?: ElementAnimation) => void;
305
+ /** Set a specific element's build animation by id — used by the slide-level build-order list. */
306
+ onSetElementAnimation?: (elementId: string, animation?: ElementAnimation) => void;
296
307
  }
297
308
  /**
298
309
  * Right-hand inspector. Tabs split position + style + advanced properties.
@@ -300,7 +311,7 @@ interface ElementInspectorProps {
300
311
  * react-fancy `Card`, `Tabs`, `Input`, `Select`, `Slider`, `ColorPicker`,
301
312
  * `Action`.
302
313
  */
303
- declare function ElementInspector({ element, onPatch, onDelete, onLockToggle, slide, onSetTransition, onSetBackground }: ElementInspectorProps): react_jsx_runtime.JSX.Element;
314
+ declare function ElementInspector({ element, onPatch, onDelete, onLockToggle, slide, onSetTransition, onSetBackground, onSetAnimation, onSetElementAnimation }: ElementInspectorProps): react_jsx_runtime.JSX.Element;
304
315
 
305
316
  interface SpeakerNotesProps {
306
317
  notes?: string;
@@ -349,6 +360,14 @@ declare function TextElementRenderer({ element, theme, slideWidthPx, editing, se
349
360
  interface ImageElementRendererProps {
350
361
  element: ImageElement;
351
362
  }
363
+ /**
364
+ * Renders an image element. When `element.crop` is set (a window in
365
+ * image-relative 0..1 coords `{x,y,w,h}`), the image is shown cropped to that
366
+ * window: an `overflow:hidden` box clips an inner `<img>` that's been scaled up
367
+ * by `1/w` × `1/h` and offset so the crop window exactly fills the box. Without
368
+ * a crop it's the plain `object-fit` image. The same renderer feeds both the
369
+ * editor canvas and the viewer, so a crop is visible everywhere.
370
+ */
352
371
  declare function ImageElementRenderer({ element }: ImageElementRendererProps): react_jsx_runtime.JSX.Element;
353
372
 
354
373
  interface ShapeElementRendererProps {
@@ -367,8 +386,19 @@ interface SlideKeyboardOptions {
367
386
  total: number;
368
387
  /** Current slide index. */
369
388
  index: number;
370
- /** Move to a specific slide. */
389
+ /** Move to a specific slide. Used by Home/End/1-9 (and by arrows when no `onAdvance`/`onRetreat`). */
371
390
  goTo: (index: number) => void;
391
+ /**
392
+ * Forward step (→ / Space / PageDown). When provided it OWNS forward nav —
393
+ * e.g. step through builds, then advance the slide. Falls back to
394
+ * `goTo(index + 1)` when omitted.
395
+ */
396
+ onAdvance?: () => void;
397
+ /**
398
+ * Backward step (← / PageUp). When provided it OWNS backward nav. Falls back
399
+ * to `goTo(index - 1)` when omitted.
400
+ */
401
+ onRetreat?: () => void;
372
402
  /** Called on Esc — typically exits fullscreen. */
373
403
  onExit?: () => void;
374
404
  /** Called on `B` — typically blacks/whites out the screen. */
@@ -381,8 +411,8 @@ interface SlideKeyboardOptions {
381
411
  /**
382
412
  * Standard slideshow keyboard plumbing:
383
413
  *
384
- * ← / PageUp — previous slide
385
- * → / PageDown / Space — next slide
414
+ * ← / PageUp — retreat (onRetreat, else previous slide)
415
+ * → / PageDown / Space — advance (onAdvance, else next slide)
386
416
  * Home — first slide
387
417
  * End — last slide
388
418
  * Esc — onExit
@@ -390,7 +420,7 @@ interface SlideKeyboardOptions {
390
420
  * F — onFullscreen
391
421
  * 1..9 — jump to slide N
392
422
  */
393
- declare function useSlideKeyboard({ total, index, goTo, onExit, onBlank, onFullscreen, enabled, }: SlideKeyboardOptions): void;
423
+ declare function useSlideKeyboard({ total, index, goTo, onAdvance, onRetreat, onExit, onBlank, onFullscreen, enabled, }: SlideKeyboardOptions): void;
394
424
 
395
425
  /**
396
426
  * Hook that wraps a controlled deck with a typed mutation API. Every helper
@@ -428,6 +458,8 @@ interface DeckStateApi {
428
458
  updateElement: (slideId: string, elementId: string, patch: Partial<SlideElement>) => void;
429
459
  moveElement: (slideId: string, elementId: string, x: number, y: number) => void;
430
460
  resizeElement: (slideId: string, elementId: string, w: number, h: number) => void;
461
+ /** Set or clear an element's entrance build animation. Pass `undefined` to clear. */
462
+ setAnimation: (slideId: string, elementId: string, animation?: ElementAnimation) => void;
431
463
  /** Convenience lookups. */
432
464
  getSlide: (id: string) => Slide$1 | undefined;
433
465
  getElement: (slideId: string, elementId: string) => SlideElement | undefined;
@@ -488,4 +520,68 @@ type ChartKind = "bar" | "line" | "pie" | "area" | "scatter";
488
520
  type Option = Record<string, unknown>;
489
521
  declare function chartStarterOption(kind: ChartKind): Option;
490
522
 
491
- export { type ChartKind$1 as ChartKind, Deck, DeckEditor, type DeckEditorProps, DeckOp, type DeckStateApi, EditorToolbar, type EditorToolbarProps, ElementInspector, type ElementInspectorProps, ImageElement, ImageElementRenderer, type ImageElementRendererProps, PresenterView, type PresenterViewProps, ShapeElement, ShapeElementRenderer, type ShapeElementRendererProps, ShapeKind, Slide, SlideBackground, type SlideContextValue, Slide$1 as SlideData, SlideElement, type SlideKeyboardOptions, SlideLayout, type SlideProps, SlideRail, type SlideRailProps, SlideThumbnail, type SlideThumbnailProps, SlideTransition, SlideViewer, type SlideViewerProps, SpeakerNotes, type SpeakerNotesProps, TextElement, TextElementRenderer, type TextElementRendererProps, Theme, type UseDeckStateOptions, builtinThemes, chartStarterOption, darkTheme, deckId, defaultTheme, defineTheme, elementId, nextId, reduce as reduceDeck, resolveTheme, slideId, useDeckState, useIsDarkSlide, useSlideContext, useSlideKeyboard, useSlideTheme, vividTheme };
523
+ /**
524
+ * Build (entrance-animation) sequencing — the shared model used by both
525
+ * `SlideViewer` and `PresenterView` so step-through behaves identically.
526
+ *
527
+ * A slide's *builds* are the elements that carry an `animation`. They are
528
+ * stable-sorted by `(order ?? 0)` then original element array index, then
529
+ * grouped into *click steps*:
530
+ *
531
+ * - The first build, and every build whose trigger is `"on-click"`, starts
532
+ * a NEW step.
533
+ * - `"with-prev"` plays simultaneously with the current step's lead.
534
+ * - `"after-prev"` plays after a delay equal to the current step's lead
535
+ * duration (chained onto its `delay`).
536
+ *
537
+ * `buildStep` semantics (used by the viewer/presenter):
538
+ * - `0` → nothing built yet; only non-animated elements are visible.
539
+ * - `n` → the first `n` steps have fired; their elements are visible.
540
+ * - `totalSteps` → every build is shown (the fully-built slide).
541
+ */
542
+
543
+ /** One element participating in a build, paired with its (defaulted) animation. */
544
+ interface Build {
545
+ element: SlideElement;
546
+ animation: ElementAnimation;
547
+ /** Original index of the element in the slide's `elements` array (tie-breaker). */
548
+ index: number;
549
+ }
550
+ /** A click step — the set of builds revealed by a single forward advance. */
551
+ interface BuildStep {
552
+ /** Builds that reveal on this step (lead first, then with-prev / after-prev). */
553
+ builds: Build[];
554
+ }
555
+ /**
556
+ * Collect a slide's builds in resolved order: every element with an
557
+ * `animation`, stable-sorted by `(order ?? 0)` then array index.
558
+ */
559
+ declare function collectBuilds(slide: Slide$1 | undefined): Build[];
560
+ /**
561
+ * Group a slide's builds into click steps. The first build always opens a
562
+ * step; thereafter an `"on-click"` trigger opens a new step while
563
+ * `"with-prev"` / `"after-prev"` attach to the current one.
564
+ */
565
+ declare function buildSteps(slide: Slide$1 | undefined): BuildStep[];
566
+ /** Total number of click steps for a slide (0 when the slide has no builds). */
567
+ declare function totalBuildSteps(slide: Slide$1 | undefined): number;
568
+ /**
569
+ * Given a slide and a `buildStep` (0..totalSteps), return the set of element
570
+ * ids that should be VISIBLE. Elements with no animation are always visible;
571
+ * animated elements become visible once their owning step has fired.
572
+ */
573
+ declare function visibleElementIds(slide: Slide$1 | undefined, buildStep: number): Set<string>;
574
+ /**
575
+ * The builds that fire when advancing INTO `buildStep` (1-based). Returns the
576
+ * lead build first; the viewer uses `with-prev` / `after-prev` to compute each
577
+ * element's effective `delay`. Empty when `buildStep` is out of range.
578
+ */
579
+ declare function buildsForStep(slide: Slide$1 | undefined, buildStep: number): Build[];
580
+ /**
581
+ * Compute the effective entrance delay (ms) for each build within a step,
582
+ * honouring `with-prev` (0 extra) and `after-prev` (lead duration). The lead
583
+ * build keeps its own `delay`; followers add to it. Keyed by element id.
584
+ */
585
+ declare function stepDelays(builds: Build[]): Map<string, number>;
586
+
587
+ export { type Build, type BuildStep, type ChartKind$1 as ChartKind, Deck, DeckEditor, type DeckEditorProps, DeckOp, type DeckStateApi, EditorToolbar, type EditorToolbarProps, ElementAnimation, ElementInspector, type ElementInspectorProps, ImageElement, ImageElementRenderer, type ImageElementRendererProps, PresenterView, type PresenterViewProps, ShapeElement, ShapeElementRenderer, type ShapeElementRendererProps, ShapeKind, Slide, SlideBackground, type SlideContextValue, Slide$1 as SlideData, SlideElement, type SlideKeyboardOptions, SlideLayout, type SlideProps, SlideRail, type SlideRailProps, SlideThumbnail, type SlideThumbnailProps, SlideTransition, SlideViewer, type SlideViewerProps, SpeakerNotes, type SpeakerNotesProps, TextElement, TextElementRenderer, type TextElementRendererProps, Theme, type UseDeckStateOptions, buildSteps, buildsForStep, builtinThemes, chartStarterOption, collectBuilds, darkTheme, deckId, defaultTheme, defineTheme, elementId, nextId, reduce as reduceDeck, resolveTheme, slideId, stepDelays, totalBuildSteps, useDeckState, useIsDarkSlide, useSlideContext, useSlideKeyboard, useSlideTheme, visibleElementIds, vividTheme };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode, CSSProperties } from 'react';
3
- import { f as Slide$1, m as Theme, h as SlideElement, D as Deck, c as DeckOp, e as ShapeKind, j as SlideTransition, g as SlideBackground, k as TextElement, I as ImageElement, S as ShapeElement, i as SlideLayout } from './types-B2ecrEAz.js';
4
- export { C as ChartElement, a as CodeElement, b as DeckActivity, E as ElementBase, d as EmbedElement, T as TableElement, l as TextStyle, n as ThemeColors, o as ThemeFonts, p as TransitionKind } from './types-B2ecrEAz.js';
3
+ import { h as Slide$1, o as Theme, j as SlideElement, D as Deck, d as DeckOp, g as ShapeKind, l as SlideTransition, i as SlideBackground, E as ElementAnimation, m as TextElement, I as ImageElement, S as ShapeElement, k as SlideLayout } from './types-P-9MmnGU.js';
4
+ export { A as AnimationEffect, a as AnimationTrigger, C as ChartElement, b as CodeElement, c as DeckActivity, e as ElementBase, f as EmbedElement, T as TableElement, n as TextStyle, p as ThemeColors, q as ThemeFonts, r as TransitionKind } from './types-P-9MmnGU.js';
5
5
 
6
6
  interface SlideProps {
7
7
  /** The slide to render. */
@@ -14,6 +14,13 @@ interface SlideProps {
14
14
  aspectRatio?: number;
15
15
  /** Edit mode flag — passed to element renderers + enables drag/resize affordances. */
16
16
  editing?: boolean;
17
+ /**
18
+ * Current build step (0..totalSteps). `0` = nothing built (only non-animated
19
+ * elements visible); each step reveals more animated elements. Omit (or pass
20
+ * a number ≥ total) to show the fully-built slide. Ignored when `editing` —
21
+ * the editor always shows every element so authors can position them.
22
+ */
23
+ buildStep?: number;
17
24
  /** Called when a text element's content is edited (only in editing mode). */
18
25
  onElementContentChange?: (elementId: string, content: string) => void;
19
26
  /** Called when an element is clicked — host-driven selection. */
@@ -47,7 +54,7 @@ interface SlideProps {
47
54
  * Both fire through `onElementMove` / `onElementResize` so the host owns
48
55
  * the state — Slide stays a pure renderer.
49
56
  */
50
- declare function Slide({ slide, theme, width, aspectRatio, editing, onElementContentChange, onElementSelect, selectedElementId, onElementMove, onElementResize, renderElement, className, style, }: SlideProps): react_jsx_runtime.JSX.Element;
57
+ declare function Slide({ slide, theme, width, aspectRatio, editing, buildStep, onElementContentChange, onElementSelect, selectedElementId, onElementMove, onElementResize, renderElement, className, style, }: SlideProps): react_jsx_runtime.JSX.Element;
51
58
 
52
59
  /**
53
60
  * What the surrounding <Slide> knows about itself. Exposed to children
@@ -293,6 +300,10 @@ interface ElementInspectorProps {
293
300
  onSetTransition?: (transition?: SlideTransition) => void;
294
301
  /** Set the slide's background. */
295
302
  onSetBackground?: (background?: SlideBackground) => void;
303
+ /** Set or clear the selected element's entrance build animation. */
304
+ onSetAnimation?: (animation?: ElementAnimation) => void;
305
+ /** Set a specific element's build animation by id — used by the slide-level build-order list. */
306
+ onSetElementAnimation?: (elementId: string, animation?: ElementAnimation) => void;
296
307
  }
297
308
  /**
298
309
  * Right-hand inspector. Tabs split position + style + advanced properties.
@@ -300,7 +311,7 @@ interface ElementInspectorProps {
300
311
  * react-fancy `Card`, `Tabs`, `Input`, `Select`, `Slider`, `ColorPicker`,
301
312
  * `Action`.
302
313
  */
303
- declare function ElementInspector({ element, onPatch, onDelete, onLockToggle, slide, onSetTransition, onSetBackground }: ElementInspectorProps): react_jsx_runtime.JSX.Element;
314
+ declare function ElementInspector({ element, onPatch, onDelete, onLockToggle, slide, onSetTransition, onSetBackground, onSetAnimation, onSetElementAnimation }: ElementInspectorProps): react_jsx_runtime.JSX.Element;
304
315
 
305
316
  interface SpeakerNotesProps {
306
317
  notes?: string;
@@ -349,6 +360,14 @@ declare function TextElementRenderer({ element, theme, slideWidthPx, editing, se
349
360
  interface ImageElementRendererProps {
350
361
  element: ImageElement;
351
362
  }
363
+ /**
364
+ * Renders an image element. When `element.crop` is set (a window in
365
+ * image-relative 0..1 coords `{x,y,w,h}`), the image is shown cropped to that
366
+ * window: an `overflow:hidden` box clips an inner `<img>` that's been scaled up
367
+ * by `1/w` × `1/h` and offset so the crop window exactly fills the box. Without
368
+ * a crop it's the plain `object-fit` image. The same renderer feeds both the
369
+ * editor canvas and the viewer, so a crop is visible everywhere.
370
+ */
352
371
  declare function ImageElementRenderer({ element }: ImageElementRendererProps): react_jsx_runtime.JSX.Element;
353
372
 
354
373
  interface ShapeElementRendererProps {
@@ -367,8 +386,19 @@ interface SlideKeyboardOptions {
367
386
  total: number;
368
387
  /** Current slide index. */
369
388
  index: number;
370
- /** Move to a specific slide. */
389
+ /** Move to a specific slide. Used by Home/End/1-9 (and by arrows when no `onAdvance`/`onRetreat`). */
371
390
  goTo: (index: number) => void;
391
+ /**
392
+ * Forward step (→ / Space / PageDown). When provided it OWNS forward nav —
393
+ * e.g. step through builds, then advance the slide. Falls back to
394
+ * `goTo(index + 1)` when omitted.
395
+ */
396
+ onAdvance?: () => void;
397
+ /**
398
+ * Backward step (← / PageUp). When provided it OWNS backward nav. Falls back
399
+ * to `goTo(index - 1)` when omitted.
400
+ */
401
+ onRetreat?: () => void;
372
402
  /** Called on Esc — typically exits fullscreen. */
373
403
  onExit?: () => void;
374
404
  /** Called on `B` — typically blacks/whites out the screen. */
@@ -381,8 +411,8 @@ interface SlideKeyboardOptions {
381
411
  /**
382
412
  * Standard slideshow keyboard plumbing:
383
413
  *
384
- * ← / PageUp — previous slide
385
- * → / PageDown / Space — next slide
414
+ * ← / PageUp — retreat (onRetreat, else previous slide)
415
+ * → / PageDown / Space — advance (onAdvance, else next slide)
386
416
  * Home — first slide
387
417
  * End — last slide
388
418
  * Esc — onExit
@@ -390,7 +420,7 @@ interface SlideKeyboardOptions {
390
420
  * F — onFullscreen
391
421
  * 1..9 — jump to slide N
392
422
  */
393
- declare function useSlideKeyboard({ total, index, goTo, onExit, onBlank, onFullscreen, enabled, }: SlideKeyboardOptions): void;
423
+ declare function useSlideKeyboard({ total, index, goTo, onAdvance, onRetreat, onExit, onBlank, onFullscreen, enabled, }: SlideKeyboardOptions): void;
394
424
 
395
425
  /**
396
426
  * Hook that wraps a controlled deck with a typed mutation API. Every helper
@@ -428,6 +458,8 @@ interface DeckStateApi {
428
458
  updateElement: (slideId: string, elementId: string, patch: Partial<SlideElement>) => void;
429
459
  moveElement: (slideId: string, elementId: string, x: number, y: number) => void;
430
460
  resizeElement: (slideId: string, elementId: string, w: number, h: number) => void;
461
+ /** Set or clear an element's entrance build animation. Pass `undefined` to clear. */
462
+ setAnimation: (slideId: string, elementId: string, animation?: ElementAnimation) => void;
431
463
  /** Convenience lookups. */
432
464
  getSlide: (id: string) => Slide$1 | undefined;
433
465
  getElement: (slideId: string, elementId: string) => SlideElement | undefined;
@@ -488,4 +520,68 @@ type ChartKind = "bar" | "line" | "pie" | "area" | "scatter";
488
520
  type Option = Record<string, unknown>;
489
521
  declare function chartStarterOption(kind: ChartKind): Option;
490
522
 
491
- export { type ChartKind$1 as ChartKind, Deck, DeckEditor, type DeckEditorProps, DeckOp, type DeckStateApi, EditorToolbar, type EditorToolbarProps, ElementInspector, type ElementInspectorProps, ImageElement, ImageElementRenderer, type ImageElementRendererProps, PresenterView, type PresenterViewProps, ShapeElement, ShapeElementRenderer, type ShapeElementRendererProps, ShapeKind, Slide, SlideBackground, type SlideContextValue, Slide$1 as SlideData, SlideElement, type SlideKeyboardOptions, SlideLayout, type SlideProps, SlideRail, type SlideRailProps, SlideThumbnail, type SlideThumbnailProps, SlideTransition, SlideViewer, type SlideViewerProps, SpeakerNotes, type SpeakerNotesProps, TextElement, TextElementRenderer, type TextElementRendererProps, Theme, type UseDeckStateOptions, builtinThemes, chartStarterOption, darkTheme, deckId, defaultTheme, defineTheme, elementId, nextId, reduce as reduceDeck, resolveTheme, slideId, useDeckState, useIsDarkSlide, useSlideContext, useSlideKeyboard, useSlideTheme, vividTheme };
523
+ /**
524
+ * Build (entrance-animation) sequencing — the shared model used by both
525
+ * `SlideViewer` and `PresenterView` so step-through behaves identically.
526
+ *
527
+ * A slide's *builds* are the elements that carry an `animation`. They are
528
+ * stable-sorted by `(order ?? 0)` then original element array index, then
529
+ * grouped into *click steps*:
530
+ *
531
+ * - The first build, and every build whose trigger is `"on-click"`, starts
532
+ * a NEW step.
533
+ * - `"with-prev"` plays simultaneously with the current step's lead.
534
+ * - `"after-prev"` plays after a delay equal to the current step's lead
535
+ * duration (chained onto its `delay`).
536
+ *
537
+ * `buildStep` semantics (used by the viewer/presenter):
538
+ * - `0` → nothing built yet; only non-animated elements are visible.
539
+ * - `n` → the first `n` steps have fired; their elements are visible.
540
+ * - `totalSteps` → every build is shown (the fully-built slide).
541
+ */
542
+
543
+ /** One element participating in a build, paired with its (defaulted) animation. */
544
+ interface Build {
545
+ element: SlideElement;
546
+ animation: ElementAnimation;
547
+ /** Original index of the element in the slide's `elements` array (tie-breaker). */
548
+ index: number;
549
+ }
550
+ /** A click step — the set of builds revealed by a single forward advance. */
551
+ interface BuildStep {
552
+ /** Builds that reveal on this step (lead first, then with-prev / after-prev). */
553
+ builds: Build[];
554
+ }
555
+ /**
556
+ * Collect a slide's builds in resolved order: every element with an
557
+ * `animation`, stable-sorted by `(order ?? 0)` then array index.
558
+ */
559
+ declare function collectBuilds(slide: Slide$1 | undefined): Build[];
560
+ /**
561
+ * Group a slide's builds into click steps. The first build always opens a
562
+ * step; thereafter an `"on-click"` trigger opens a new step while
563
+ * `"with-prev"` / `"after-prev"` attach to the current one.
564
+ */
565
+ declare function buildSteps(slide: Slide$1 | undefined): BuildStep[];
566
+ /** Total number of click steps for a slide (0 when the slide has no builds). */
567
+ declare function totalBuildSteps(slide: Slide$1 | undefined): number;
568
+ /**
569
+ * Given a slide and a `buildStep` (0..totalSteps), return the set of element
570
+ * ids that should be VISIBLE. Elements with no animation are always visible;
571
+ * animated elements become visible once their owning step has fired.
572
+ */
573
+ declare function visibleElementIds(slide: Slide$1 | undefined, buildStep: number): Set<string>;
574
+ /**
575
+ * The builds that fire when advancing INTO `buildStep` (1-based). Returns the
576
+ * lead build first; the viewer uses `with-prev` / `after-prev` to compute each
577
+ * element's effective `delay`. Empty when `buildStep` is out of range.
578
+ */
579
+ declare function buildsForStep(slide: Slide$1 | undefined, buildStep: number): Build[];
580
+ /**
581
+ * Compute the effective entrance delay (ms) for each build within a step,
582
+ * honouring `with-prev` (0 extra) and `after-prev` (lead duration). The lead
583
+ * build keeps its own `delay`; followers add to it. Keyed by element id.
584
+ */
585
+ declare function stepDelays(builds: Build[]): Map<string, number>;
586
+
587
+ export { type Build, type BuildStep, type ChartKind$1 as ChartKind, Deck, DeckEditor, type DeckEditorProps, DeckOp, type DeckStateApi, EditorToolbar, type EditorToolbarProps, ElementAnimation, ElementInspector, type ElementInspectorProps, ImageElement, ImageElementRenderer, type ImageElementRendererProps, PresenterView, type PresenterViewProps, ShapeElement, ShapeElementRenderer, type ShapeElementRendererProps, ShapeKind, Slide, SlideBackground, type SlideContextValue, Slide$1 as SlideData, SlideElement, type SlideKeyboardOptions, SlideLayout, type SlideProps, SlideRail, type SlideRailProps, SlideThumbnail, type SlideThumbnailProps, SlideTransition, SlideViewer, type SlideViewerProps, SpeakerNotes, type SpeakerNotesProps, TextElement, TextElementRenderer, type TextElementRendererProps, Theme, type UseDeckStateOptions, buildSteps, buildsForStep, builtinThemes, chartStarterOption, collectBuilds, darkTheme, deckId, defaultTheme, defineTheme, elementId, nextId, reduce as reduceDeck, resolveTheme, slideId, stepDelays, totalBuildSteps, useDeckState, useIsDarkSlide, useSlideContext, useSlideKeyboard, useSlideTheme, visibleElementIds, vividTheme };