@nextgensoftwares/folio-plugin-slides-motion
Animations, transitions and presenting for React slides apps, on the engine in folio-slides-motion. One plugin adds it all to SlidesApp; every piece is also exported for custom shells. Guides: Slide animations, Presenting.
tsx
import { motionUiPlugin } from '@nextgensoftwares/folio-plugin-slides-motion';
const deck = createDeckEditor({ presentation, plugins: [motionUiPlugin({ audienceUrl: (ch) => `/show?audience=${ch}` })] });
<SlidesApp deck={deck} measurer={fonts} resolveSrc={media.resolve} />;Plugin
| Export | Description |
|---|---|
motionUiPlugin(options?), MotionUiOptions | the /editor commands, the ribbon's Transitions and Animations tabs (slots ribbon.transitions, ribbon.animations), Presenter view and Rehearse in ribbon.slideShow, the Animation pane inspector tab, numbers on the canvas ('surface' slot), and the show ('presenter' slot) with present.start, present.presenter (Alt+F5), present.rehearse. Options: motion ('full', 'reduced', 'system'), audienceUrl(channel), media(src), badges, askToKeep (ink and rehearsed timings), transitionsPane (also a Transitions inspector tab; default false), muted (the host's mute switch for show sounds) |
RibbonTransitions, RibbonAnimations | the ribbon tabs' content, for a custom ribbon |
Show
| Export | Description |
|---|---|
SlideShow, SlideShowProps, ShowResult | the full-screen show (keys, laser, ink, black/white, presenter popup, audience windows, sounds and media); onEnd({ last, ink, timings? }); resolveSrc(src) for media URLs, muted, recording (a RecordingHost), notes (false: no notes in the presenter view), shareNotesWithAudience (default false: audience windows get the deck without speaker notes), onPopupBlocked (the browser blocked the presenter view's popup) |
AudienceView, AudienceViewProps | the audience's view of a ShowController (fitted slide, ink, laser, clicks play triggers or advance) |
PresenterConsole, PresenterConsoleProps | the presenter view: live slide, next build or slide, notes (zoomable; notes: false leaves them out), timer and clock, counter, all slides, tools (tools: more of them) |
AudienceWindow, AudienceWindowProps | a window that joins a show's channel, gets the deck and media from the presenter and follows it; prepare(deck) loads fonts first; sound (default false: the presenter's window plays sounds), muted; images(src) (the host's picture loader, wins over the rest), resolveSrc(src) (non-media: picture srcs such as /folio-media/<id> to a URL, sync or async), resolveSrcs(ids, { purpose }) (the deck's picture srcs in one call before the deck shows; null falls back to resolveSrc). Labels come from the SlidesLocaleContext above the window |
SlideStage, SlideStageProps | a canvas playing a ShowController |
MediaLayer, MediaLayerProps, ShowAudio, runVerb(el, verb, from?) | the show's sounds and the slide's audio/video shapes, driven by its media commands (videos over their frames; leaving the slide stops them). ShowAudio { enabled?, muted? }: audience windows following a presenter default to no sound. A clip whose src resolves to '' or fails to load shows folio-plugin-slides' media notice over its frame (mediaNotice? / renderMediaNotice? props, else the DeckProvider's) |
SoundBank, useShowCues(show, onCue), isMuted, MutedSetting | transition and effect sounds (a looping sound plays until the next; refused plays wait for a gesture: "Click to turn on sound"); running a show's cues as time passes; the host's mute switch (boolean or () => boolean) |
InkOverlay, InkOverlayProps, InkStore, InkTool | pen, highlighter, eraser and laser over a stage; strokes per slide, synced over the channel. Pointer moves never render: the laser is one element moved with a transform in the frame of the move (InkStore.onLaser(fn); other windows get one update per frame), the stroke being drawn grows its path in place from every coalesced point. The pointer stays the native cursor except with the laser |
SlideGrid, SlideGridProps, Timer | "see all slides"; elapsed time and clock |
createShowKeys(show, ink, actions), ShowKeyActions | PowerPoint's slide-show keys |
ShowChannel, linkShow(show, channel), newShowName(), ShowMessage, MediaMap | presenter ⇄ audience sync over BroadcastChannel (state, deck, ink, laser, end) |
usePopup(open, opts), copyFonts(from, to) | a same-origin popup to portal into (the presenter view needs no route); it gets the deck's loaded web fonts; onPopupBlocked runs when the browser blocks it (onClose runs too) |
useShowController(pres, start, opts), useShowState(show), usePrefersReducedMotion(), slideColors(pres, i), MotionSetting | hooks |
Panels
| Export | Description |
|---|---|
AnimationPane | effects in play order (click numbers, start, triggers), add/change from the gallery, drag to reorder, options, Play |
EffectGallery, EffectGalleryProps, EffectPreview, EffectPreviewProps | presets by class with a live preview on the selected shapes; a small preview of effects or a transition |
EffectOptions, EffectOptionsProps | effect and direction, start, delay, duration, repeat, rewind, animate text, trigger |
TransitionsPanel, TRANSITION_KINDS | effect with preview, option, duration, advance on click / after, apply to all |
AnimationBadges | animation numbers on the editing canvas (a 'surface' slot component) |
Rendering
| Export | Description |
|---|---|
StagePainter, StageOptions | paints a show onto a canvas while something moves, then idles; stats (frames, skipped, paint ms) |
paintSlide(ctx, page, timeline, frame, context), PaintContext, LayerCache | one moment of a slide: runs of still fragments from cached layers, moving ones live |
planOf(page), partsOf(item), paragraphGroups(fragments), PaintPlan, PlanItem | a page's fragments by shape; a shape split into body and paragraphs |
buildElements(fragment, type, measure), BuildElement, elementBoxes(...), canvasMeasure(ctx), Measure | the words / letters of a paragraph for a by-word / by-letter build: each one's box and a fragment drawing only it at its layout position. measure is the layout's TextMeasurer (its glyph positions; the stage passes layout.measurer) or a width function |
drawAnimated(...), transformAround(ctx, box, state) | one fragment with a MotionState |
compositeTransition(...), drawLayer(...), paintMorph(...) | transitions and morph |
MOTION_CSS, ensureMotionCss(doc?) | styles (--folio-* tokens; nothing injected under setFolioUnstyled) |
Recording
See Recording a show.
| Export | Description |
|---|---|
recordingPlugin(host), RecordingHost | recording mode (with motionUiPlugin): Record on the Slide Show tab, present.record. host: onTrack(track), onEvent?(event) (live), onState?(state) (start / pause / resume / stop your media recorder with it), webcam? (a MediaStream or your element), stage? (StageLayout), autoStart?, onStream?(stream) + fps? (the composited stage as a MediaStream) |
recordingFor(deck), clearRecording(deck) | the recording a deck's next show was started for |
useShowRecorder(show, ink, store, host), RecorderControls | records a running show: state, start, pause, resume (ink redrawn from what is on screen), stop, time(), recorder |
RecordingStore, RecordTool | the recorded show's overlays: tool (type, spotlight, zoom), pointer, spotlight radius, zoom, typing target, live text, overlay visibility, hidden (clean shot); every change recorded. Pointer moves (setPointer) are not store changes: the drawn cursor, laser and spotlight follow onPointer(fn) in the frame of the move, unsmoothed (gliding is for replays) |
RecordingView, RecordingViewProps | the audience's stage in recording mode (layout, cursor, laser, ink, spotlight, zoom, typing; nothing presenter-only) |
RecordingControls | Record / Pause / Resume / Stop with the time, and the tools, for the presenter view |
createRecordKeys(store) | T type, S spotlight, Z zoom, C cursor, V webcam, O hide overlays, Esc tool off; text keys while typing |
InkEvent | stroke progress from InkStore.onInk (start, point, end, remove, clear) |
ShowReplay, ShowReplayProps | a track replayed as a re-render in sync with media.currentTime (or time()): slides and builds, ink, the gliding cursor, spotlight, zoom, live text, webcam bubble; also on the lean /replay entry |
StageFrame, StageFrameProps, StageLayout, zoomTransform | the recording layout: fixed aspect (16:9), slide fitted, safe area, webcam bubble, zoom |
RecordingOverlay, RecordingOverlayProps, InkPaths, WebcamBubble | cursor / laser, spotlight, typing indicator, ink, styled for video |
drawComposite(ctx, w, h, frame), compositeStream(frame, opts), CompositeFrame | the stage and its overlays drawn into one canvas; its captureStream |