@particle-academy/fancy-slides 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/index.cjs +200 -114
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +109 -68
- package/dist/index.d.ts +109 -68
- package/dist/index.js +199 -116
- package/dist/index.js.map +1 -1
- package/dist/registry.d.cts +1 -1
- package/dist/registry.d.ts +1 -1
- package/dist/{types-P-9MmnGU.d.cts → types-9BbelJX1.d.cts} +10 -0
- package/dist/{types-P-9MmnGU.d.ts → types-9BbelJX1.d.ts} +10 -0
- package/package.json +1 -1
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 { 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-
|
|
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-
|
|
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-9BbelJX1.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-9BbelJX1.cjs';
|
|
5
5
|
|
|
6
6
|
interface SlideProps {
|
|
7
7
|
/** The slide to render. */
|
|
@@ -325,6 +325,103 @@ interface SpeakerNotesProps {
|
|
|
325
325
|
*/
|
|
326
326
|
declare function SpeakerNotes({ notes, onChange, placeholder }: SpeakerNotesProps): react_jsx_runtime.JSX.Element;
|
|
327
327
|
|
|
328
|
+
/**
|
|
329
|
+
* Build (entrance-animation) sequencing — the shared model used by both
|
|
330
|
+
* `SlideViewer` and `PresenterView` so step-through behaves identically.
|
|
331
|
+
*
|
|
332
|
+
* A slide's *builds* are the elements that carry an `animation`. They are
|
|
333
|
+
* stable-sorted by `(order ?? 0)` then original element array index, then
|
|
334
|
+
* grouped into *click steps*:
|
|
335
|
+
*
|
|
336
|
+
* - The first build, and every build whose trigger is `"on-click"`, starts
|
|
337
|
+
* a NEW step.
|
|
338
|
+
* - `"with-prev"` plays simultaneously with the current step's lead.
|
|
339
|
+
* - `"after-prev"` plays after a delay equal to the current step's lead
|
|
340
|
+
* duration (chained onto its `delay`).
|
|
341
|
+
*
|
|
342
|
+
* `buildStep` semantics (used by the viewer/presenter):
|
|
343
|
+
* - `0` → nothing built yet; only non-animated elements are visible.
|
|
344
|
+
* - `n` → the first `n` steps have fired; their elements are visible.
|
|
345
|
+
* - `totalSteps` → every build is shown (the fully-built slide).
|
|
346
|
+
*/
|
|
347
|
+
|
|
348
|
+
/** One element participating in a build, paired with its (defaulted) animation. */
|
|
349
|
+
interface Build {
|
|
350
|
+
element: SlideElement;
|
|
351
|
+
animation: ElementAnimation;
|
|
352
|
+
/** Original index of the element in the slide's `elements` array (tie-breaker). */
|
|
353
|
+
index: number;
|
|
354
|
+
/**
|
|
355
|
+
* For a "by paragraph" text build, which paragraph index (0-based) this
|
|
356
|
+
* build reveals. Undefined for whole-element builds. The renderer uses this
|
|
357
|
+
* to show "the first K paragraphs of this element".
|
|
358
|
+
*/
|
|
359
|
+
paraIndex?: number;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Split a text element's `content` into paragraphs for a "by paragraph" build.
|
|
363
|
+
* Splits on `"\n"` and drops a single trailing empty line (so content ending in
|
|
364
|
+
* a newline doesn't manifest a phantom blank build). Empty interior lines are
|
|
365
|
+
* preserved — they still consume a click, matching PowerPoint's behaviour.
|
|
366
|
+
*/
|
|
367
|
+
declare function splitParagraphs(content: string): string[];
|
|
368
|
+
/**
|
|
369
|
+
* Whether an element expands into per-paragraph builds: a text element whose
|
|
370
|
+
* animation has `byParagraph` and that splits into 2+ paragraphs. With 0/1
|
|
371
|
+
* paragraphs it behaves like a normal single build.
|
|
372
|
+
*/
|
|
373
|
+
declare function isByParagraph(element: SlideElement, animation: ElementAnimation): boolean;
|
|
374
|
+
/** A click step — the set of builds revealed by a single forward advance. */
|
|
375
|
+
interface BuildStep {
|
|
376
|
+
/** Builds that reveal on this step (lead first, then with-prev / after-prev). */
|
|
377
|
+
builds: Build[];
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Collect a slide's builds in resolved order: every element with an
|
|
381
|
+
* `animation`, stable-sorted by `(order ?? 0)` then array index.
|
|
382
|
+
*/
|
|
383
|
+
declare function collectBuilds(slide: Slide$1 | undefined): Build[];
|
|
384
|
+
/**
|
|
385
|
+
* Group a slide's builds into click steps. The first build always opens a
|
|
386
|
+
* step; thereafter an `"on-click"` trigger opens a new step while
|
|
387
|
+
* `"with-prev"` / `"after-prev"` attach to the current one.
|
|
388
|
+
*/
|
|
389
|
+
declare function buildSteps(slide: Slide$1 | undefined): BuildStep[];
|
|
390
|
+
/** Total number of click steps for a slide (0 when the slide has no builds). */
|
|
391
|
+
declare function totalBuildSteps(slide: Slide$1 | undefined): number;
|
|
392
|
+
/**
|
|
393
|
+
* Given a slide and a `buildStep` (0..totalSteps), return the set of element
|
|
394
|
+
* ids that should be VISIBLE. Elements with no animation are always visible;
|
|
395
|
+
* animated elements become visible once their owning step has fired.
|
|
396
|
+
*/
|
|
397
|
+
declare function visibleElementIds(slide: Slide$1 | undefined, buildStep: number): Set<string>;
|
|
398
|
+
/**
|
|
399
|
+
* Per-element paragraph reveal state for a "by paragraph" text build at a given
|
|
400
|
+
* `buildStep`. Keyed by element id:
|
|
401
|
+
* - `revealed` — how many paragraphs (0..count) should be shown so far.
|
|
402
|
+
* - `firingParaIndex` — the paragraph index revealing on the step that just
|
|
403
|
+
* fired (so the renderer plays its entrance effect), or `undefined` when no
|
|
404
|
+
* paragraph of this element fires on `buildStep`.
|
|
405
|
+
* Only elements that actually expand by-paragraph appear in the map.
|
|
406
|
+
*/
|
|
407
|
+
interface ParaReveal {
|
|
408
|
+
revealed: number;
|
|
409
|
+
firingParaIndex?: number;
|
|
410
|
+
}
|
|
411
|
+
declare function paragraphReveals(slide: Slide$1 | undefined, buildStep: number): Map<string, ParaReveal>;
|
|
412
|
+
/**
|
|
413
|
+
* The builds that fire when advancing INTO `buildStep` (1-based). Returns the
|
|
414
|
+
* lead build first; the viewer uses `with-prev` / `after-prev` to compute each
|
|
415
|
+
* element's effective `delay`. Empty when `buildStep` is out of range.
|
|
416
|
+
*/
|
|
417
|
+
declare function buildsForStep(slide: Slide$1 | undefined, buildStep: number): Build[];
|
|
418
|
+
/**
|
|
419
|
+
* Compute the effective entrance delay (ms) for each build within a step,
|
|
420
|
+
* honouring `with-prev` (0 extra) and `after-prev` (lead duration). The lead
|
|
421
|
+
* build keeps its own `delay`; followers add to it. Keyed by element id.
|
|
422
|
+
*/
|
|
423
|
+
declare function stepDelays(builds: Build[]): Map<string, number>;
|
|
424
|
+
|
|
328
425
|
interface TextElementRendererProps {
|
|
329
426
|
element: TextElement;
|
|
330
427
|
theme?: Theme;
|
|
@@ -342,6 +439,14 @@ interface TextElementRendererProps {
|
|
|
342
439
|
selected?: boolean;
|
|
343
440
|
/** Called when the user edits the content (only fires when the textarea is focusable). */
|
|
344
441
|
onContentChange?: (content: string) => void;
|
|
442
|
+
/**
|
|
443
|
+
* By-paragraph reveal state, set by `<Slide>` in viewer mode when this text
|
|
444
|
+
* element has a `byParagraph` animation. When present, the renderer splits
|
|
445
|
+
* `content` on `"\n"` and shows only the first `revealed` paragraphs,
|
|
446
|
+
* animating the one at `firingParaIndex`. Ignored in editing mode (the full
|
|
447
|
+
* text always renders so authors can position/edit it).
|
|
448
|
+
*/
|
|
449
|
+
paraReveal?: ParaReveal;
|
|
345
450
|
}
|
|
346
451
|
/**
|
|
347
452
|
* Renderer for `text` elements. Three formats:
|
|
@@ -355,7 +460,7 @@ interface TextElementRendererProps {
|
|
|
355
460
|
* In editing mode + when the element is selected, the renderer swaps to a
|
|
356
461
|
* textarea showing the raw source. Edits flow back via `onContentChange`.
|
|
357
462
|
*/
|
|
358
|
-
declare function TextElementRenderer({ element, theme, slideWidthPx, editing, selected, onContentChange, }: TextElementRendererProps): react_jsx_runtime.JSX.Element;
|
|
463
|
+
declare function TextElementRenderer({ element, theme, slideWidthPx, editing, selected, onContentChange, paraReveal, }: TextElementRendererProps): react_jsx_runtime.JSX.Element;
|
|
359
464
|
|
|
360
465
|
interface ImageElementRendererProps {
|
|
361
466
|
element: ImageElement;
|
|
@@ -520,68 +625,4 @@ type ChartKind = "bar" | "line" | "pie" | "area" | "scatter";
|
|
|
520
625
|
type Option = Record<string, unknown>;
|
|
521
626
|
declare function chartStarterOption(kind: ChartKind): Option;
|
|
522
627
|
|
|
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 };
|
|
628
|
+
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, type ParaReveal, 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, isByParagraph, nextId, paragraphReveals, reduce as reduceDeck, resolveTheme, slideId, splitParagraphs, 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 { 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-
|
|
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-
|
|
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-9BbelJX1.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-9BbelJX1.js';
|
|
5
5
|
|
|
6
6
|
interface SlideProps {
|
|
7
7
|
/** The slide to render. */
|
|
@@ -325,6 +325,103 @@ interface SpeakerNotesProps {
|
|
|
325
325
|
*/
|
|
326
326
|
declare function SpeakerNotes({ notes, onChange, placeholder }: SpeakerNotesProps): react_jsx_runtime.JSX.Element;
|
|
327
327
|
|
|
328
|
+
/**
|
|
329
|
+
* Build (entrance-animation) sequencing — the shared model used by both
|
|
330
|
+
* `SlideViewer` and `PresenterView` so step-through behaves identically.
|
|
331
|
+
*
|
|
332
|
+
* A slide's *builds* are the elements that carry an `animation`. They are
|
|
333
|
+
* stable-sorted by `(order ?? 0)` then original element array index, then
|
|
334
|
+
* grouped into *click steps*:
|
|
335
|
+
*
|
|
336
|
+
* - The first build, and every build whose trigger is `"on-click"`, starts
|
|
337
|
+
* a NEW step.
|
|
338
|
+
* - `"with-prev"` plays simultaneously with the current step's lead.
|
|
339
|
+
* - `"after-prev"` plays after a delay equal to the current step's lead
|
|
340
|
+
* duration (chained onto its `delay`).
|
|
341
|
+
*
|
|
342
|
+
* `buildStep` semantics (used by the viewer/presenter):
|
|
343
|
+
* - `0` → nothing built yet; only non-animated elements are visible.
|
|
344
|
+
* - `n` → the first `n` steps have fired; their elements are visible.
|
|
345
|
+
* - `totalSteps` → every build is shown (the fully-built slide).
|
|
346
|
+
*/
|
|
347
|
+
|
|
348
|
+
/** One element participating in a build, paired with its (defaulted) animation. */
|
|
349
|
+
interface Build {
|
|
350
|
+
element: SlideElement;
|
|
351
|
+
animation: ElementAnimation;
|
|
352
|
+
/** Original index of the element in the slide's `elements` array (tie-breaker). */
|
|
353
|
+
index: number;
|
|
354
|
+
/**
|
|
355
|
+
* For a "by paragraph" text build, which paragraph index (0-based) this
|
|
356
|
+
* build reveals. Undefined for whole-element builds. The renderer uses this
|
|
357
|
+
* to show "the first K paragraphs of this element".
|
|
358
|
+
*/
|
|
359
|
+
paraIndex?: number;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Split a text element's `content` into paragraphs for a "by paragraph" build.
|
|
363
|
+
* Splits on `"\n"` and drops a single trailing empty line (so content ending in
|
|
364
|
+
* a newline doesn't manifest a phantom blank build). Empty interior lines are
|
|
365
|
+
* preserved — they still consume a click, matching PowerPoint's behaviour.
|
|
366
|
+
*/
|
|
367
|
+
declare function splitParagraphs(content: string): string[];
|
|
368
|
+
/**
|
|
369
|
+
* Whether an element expands into per-paragraph builds: a text element whose
|
|
370
|
+
* animation has `byParagraph` and that splits into 2+ paragraphs. With 0/1
|
|
371
|
+
* paragraphs it behaves like a normal single build.
|
|
372
|
+
*/
|
|
373
|
+
declare function isByParagraph(element: SlideElement, animation: ElementAnimation): boolean;
|
|
374
|
+
/** A click step — the set of builds revealed by a single forward advance. */
|
|
375
|
+
interface BuildStep {
|
|
376
|
+
/** Builds that reveal on this step (lead first, then with-prev / after-prev). */
|
|
377
|
+
builds: Build[];
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Collect a slide's builds in resolved order: every element with an
|
|
381
|
+
* `animation`, stable-sorted by `(order ?? 0)` then array index.
|
|
382
|
+
*/
|
|
383
|
+
declare function collectBuilds(slide: Slide$1 | undefined): Build[];
|
|
384
|
+
/**
|
|
385
|
+
* Group a slide's builds into click steps. The first build always opens a
|
|
386
|
+
* step; thereafter an `"on-click"` trigger opens a new step while
|
|
387
|
+
* `"with-prev"` / `"after-prev"` attach to the current one.
|
|
388
|
+
*/
|
|
389
|
+
declare function buildSteps(slide: Slide$1 | undefined): BuildStep[];
|
|
390
|
+
/** Total number of click steps for a slide (0 when the slide has no builds). */
|
|
391
|
+
declare function totalBuildSteps(slide: Slide$1 | undefined): number;
|
|
392
|
+
/**
|
|
393
|
+
* Given a slide and a `buildStep` (0..totalSteps), return the set of element
|
|
394
|
+
* ids that should be VISIBLE. Elements with no animation are always visible;
|
|
395
|
+
* animated elements become visible once their owning step has fired.
|
|
396
|
+
*/
|
|
397
|
+
declare function visibleElementIds(slide: Slide$1 | undefined, buildStep: number): Set<string>;
|
|
398
|
+
/**
|
|
399
|
+
* Per-element paragraph reveal state for a "by paragraph" text build at a given
|
|
400
|
+
* `buildStep`. Keyed by element id:
|
|
401
|
+
* - `revealed` — how many paragraphs (0..count) should be shown so far.
|
|
402
|
+
* - `firingParaIndex` — the paragraph index revealing on the step that just
|
|
403
|
+
* fired (so the renderer plays its entrance effect), or `undefined` when no
|
|
404
|
+
* paragraph of this element fires on `buildStep`.
|
|
405
|
+
* Only elements that actually expand by-paragraph appear in the map.
|
|
406
|
+
*/
|
|
407
|
+
interface ParaReveal {
|
|
408
|
+
revealed: number;
|
|
409
|
+
firingParaIndex?: number;
|
|
410
|
+
}
|
|
411
|
+
declare function paragraphReveals(slide: Slide$1 | undefined, buildStep: number): Map<string, ParaReveal>;
|
|
412
|
+
/**
|
|
413
|
+
* The builds that fire when advancing INTO `buildStep` (1-based). Returns the
|
|
414
|
+
* lead build first; the viewer uses `with-prev` / `after-prev` to compute each
|
|
415
|
+
* element's effective `delay`. Empty when `buildStep` is out of range.
|
|
416
|
+
*/
|
|
417
|
+
declare function buildsForStep(slide: Slide$1 | undefined, buildStep: number): Build[];
|
|
418
|
+
/**
|
|
419
|
+
* Compute the effective entrance delay (ms) for each build within a step,
|
|
420
|
+
* honouring `with-prev` (0 extra) and `after-prev` (lead duration). The lead
|
|
421
|
+
* build keeps its own `delay`; followers add to it. Keyed by element id.
|
|
422
|
+
*/
|
|
423
|
+
declare function stepDelays(builds: Build[]): Map<string, number>;
|
|
424
|
+
|
|
328
425
|
interface TextElementRendererProps {
|
|
329
426
|
element: TextElement;
|
|
330
427
|
theme?: Theme;
|
|
@@ -342,6 +439,14 @@ interface TextElementRendererProps {
|
|
|
342
439
|
selected?: boolean;
|
|
343
440
|
/** Called when the user edits the content (only fires when the textarea is focusable). */
|
|
344
441
|
onContentChange?: (content: string) => void;
|
|
442
|
+
/**
|
|
443
|
+
* By-paragraph reveal state, set by `<Slide>` in viewer mode when this text
|
|
444
|
+
* element has a `byParagraph` animation. When present, the renderer splits
|
|
445
|
+
* `content` on `"\n"` and shows only the first `revealed` paragraphs,
|
|
446
|
+
* animating the one at `firingParaIndex`. Ignored in editing mode (the full
|
|
447
|
+
* text always renders so authors can position/edit it).
|
|
448
|
+
*/
|
|
449
|
+
paraReveal?: ParaReveal;
|
|
345
450
|
}
|
|
346
451
|
/**
|
|
347
452
|
* Renderer for `text` elements. Three formats:
|
|
@@ -355,7 +460,7 @@ interface TextElementRendererProps {
|
|
|
355
460
|
* In editing mode + when the element is selected, the renderer swaps to a
|
|
356
461
|
* textarea showing the raw source. Edits flow back via `onContentChange`.
|
|
357
462
|
*/
|
|
358
|
-
declare function TextElementRenderer({ element, theme, slideWidthPx, editing, selected, onContentChange, }: TextElementRendererProps): react_jsx_runtime.JSX.Element;
|
|
463
|
+
declare function TextElementRenderer({ element, theme, slideWidthPx, editing, selected, onContentChange, paraReveal, }: TextElementRendererProps): react_jsx_runtime.JSX.Element;
|
|
359
464
|
|
|
360
465
|
interface ImageElementRendererProps {
|
|
361
466
|
element: ImageElement;
|
|
@@ -520,68 +625,4 @@ type ChartKind = "bar" | "line" | "pie" | "area" | "scatter";
|
|
|
520
625
|
type Option = Record<string, unknown>;
|
|
521
626
|
declare function chartStarterOption(kind: ChartKind): Option;
|
|
522
627
|
|
|
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 };
|
|
628
|
+
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, type ParaReveal, 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, isByParagraph, nextId, paragraphReveals, reduce as reduceDeck, resolveTheme, slideId, splitParagraphs, stepDelays, totalBuildSteps, useDeckState, useIsDarkSlide, useSlideContext, useSlideKeyboard, useSlideTheme, visibleElementIds, vividTheme };
|