@bendyline/squisq-react 2.12.33 → 2.12.35

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.
@@ -1,4 +1,4 @@
1
- export { B as BlockMarker, c as BlockRenderer, C as CaptionMode, d as CaptionOverlay, f as CaptionStyle, g as ControlsLayout, D as DisplayMode, h as DocControlsBottom, i as DocControlsOverlay, j as DocControlsSidebar, k as DocControlsSlideshow, l as DocPlayer, m as DocPlayerProps, n as DocPlayerWithSidebar, o as DocProgressBar, F as FlashcardFaceView, p as FlashcardFaceViewProps, q as FlashcardView, r as FlashcardViewProps, I as InlineAudioPlayer, s as InlineAudioPlayerProps, t as InlineVideoPlayer, u as InlineVideoPlayerProps, M as MediaClipLayer, v as MediaClipLayerProps, b as PipPosition, a as PipShape, P as PipSize, w as PlaybackActions, x as PlaybackState, R as RenderAudioSegmentInfo, y as RenderBlockInfo, z as RenderCaptionInfo, A as RenderChapterInfo, G as SlideNavActions, H as SocialCaptionOverlay, S as SquisqRenderAPI, V as VideoPresentation, J as formatTime } from '../player-Wc6Nd4p5.js';
1
+ export { B as BlockMarker, d as BlockRenderer, C as CaptionMode, e as CaptionOverlay, g as CaptionStyle, h as ControlsLayout, D as DisplayMode, i as DocControlsBottom, j as DocControlsOverlay, k as DocControlsSidebar, l as DocControlsSlideshow, m as DocPlayer, n as DocPlayerProps, o as DocPlayerWithSidebar, p as DocProgressBar, q as FlashcardFaceView, r as FlashcardFaceViewProps, t as FlashcardView, u as FlashcardViewProps, I as InlineAudioPlayer, v as InlineAudioPlayerProps, w as InlineVideoPlayer, x as InlineVideoPlayerProps, M as MediaClipLayer, y as MediaClipLayerProps, c as PipPosition, b as PipShape, a as PipSize, z as PlaybackActions, A as PlaybackState, R as RenderAudioSegmentInfo, E as RenderBlockInfo, G as RenderCaptionInfo, H as RenderChapterInfo, K as SlideNavActions, O as SocialCaptionOverlay, S as SquisqRenderAPI, V as VideoPresentation, Q as formatTime } from '../player-XTHVuSvh.js';
2
2
  export { a as CodeBlockCopyContext, C as CodeBlockCopyHandler } from '../MarkdownRenderer-C63CQ9Ca.js';
3
3
  import 'react';
4
4
  import '@bendyline/squisq/schemas';
@@ -12,7 +12,7 @@ import {
12
12
  MediaClipLayer,
13
13
  SocialCaptionOverlay,
14
14
  formatTime
15
- } from "../chunk-IPTOV4W7.js";
15
+ } from "../chunk-MPOU5JC4.js";
16
16
  import "../chunk-MLONAXXN.js";
17
17
  import "../chunk-EQCHV3QH.js";
18
18
  import "../chunk-TT6ENR6T.js";
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
- import { CSSProperties } from 'react';
2
+ import { ReactNode, CSSProperties } from 'react';
3
3
  import { Block, VideoPresentation as VideoPresentation$1, VideoPipSize, VideoPipShape, VideoPipPosition, Doc, MediaScheduleOptions, Theme, MotionSpec, SurfaceScheme, BuildCursor, Transition, CaptionTrack, ViewportConfig as ViewportConfig$1, CustomTemplateDefinition, MediaEdits, ScheduledClip } from '@bendyline/squisq/schemas';
4
- import { ViewportConfig, DashboardStyleId, CoverSlideTemplate, CoverSlidePlayback, FlashcardFace, FlashcardSourceMode } from '@bendyline/squisq/doc';
4
+ import { ViewportConfig, DashboardStyleId, CoverSlideTemplate, CoverSlidePlayback, Flashcard, FlashcardFace, FlashcardSourceMode } from '@bendyline/squisq/doc';
5
5
  import { FenceRendererMap } from '@bendyline/squisq/fence';
6
6
  import { a as AudioController } from './AudioController-DAwQyEM_.js';
7
7
  import { C as CodeBlockCopyHandler } from './MarkdownRenderer-C63CQ9Ca.js';
@@ -223,6 +223,43 @@ type RenderVideoFrameSelector = (video: HTMLVideoElement, targetTime: number) =>
223
223
  /** Format time in seconds to MM:SS string */
224
224
  declare function formatTime(seconds: number): string;
225
225
 
226
+ interface SlideshowPickerItem {
227
+ /** Stable identifier for the slide/block. */
228
+ id: string;
229
+ /** Human-facing slide number, or a special label such as "Cover". */
230
+ label: string;
231
+ /** Short description shown in the slide picker. */
232
+ summary: string;
233
+ }
234
+ /**
235
+ * What slideshow controls draw from: the overlay pill here, or a host's own
236
+ * through DocPlayer's `renderSlideshowControls`.
237
+ */
238
+ interface SlideshowControlsProps {
239
+ state: PlaybackState;
240
+ slideNav: SlideNavActions;
241
+ /** Slides available for direct navigation from the counter popover. */
242
+ slides?: readonly SlideshowPickerItem[];
243
+ /** Controlled open state for hosts that expose their own picker shortcut. */
244
+ pickerOpen?: boolean;
245
+ /** Called whenever the slide picker should open or close. */
246
+ onPickerOpenChange?: (open: boolean) => void;
247
+ }
248
+ declare function DocControlsSlideshow({ state, slideNav, slides, pickerOpen, onPickerOpenChange, }: SlideshowControlsProps): react.JSX.Element;
249
+
250
+ /**
251
+ * What playback controls draw from: the overlay here, DocControlsCompact, or
252
+ * a host's own through DocPlayer's `renderPlaybackControls`.
253
+ */
254
+ interface PlaybackControlsProps {
255
+ state: PlaybackState;
256
+ actions: PlaybackActions;
257
+ blockMarkers: BlockMarker[];
258
+ expandedBlocks: Block[];
259
+ getBlockTitle?: (block: Block) => string;
260
+ }
261
+ declare function DocControlsOverlay({ state, actions, blockMarkers, expandedBlocks, getBlockTitle, }: PlaybackControlsProps): react.JSX.Element;
262
+
226
263
  interface DocPlayerProps {
227
264
  /** The Doc to play. Wins over `markdown` when both are provided. */
228
265
  doc?: Doc;
@@ -331,6 +368,24 @@ interface DocPlayerProps {
331
368
  fenceRenderers?: FenceRendererMap;
332
369
  /** Optional host renderer for interactive table-layer content. */
333
370
  tableContentRenderer?: TableLayerContentRenderer;
371
+ /**
372
+ * Slideshow mode: draws the slide navigation (previous / counter / next,
373
+ * the slide picker, build steps) in place of the player's own overlay
374
+ * pill — typically portaled into the host's chrome, as the editor's status
375
+ * bar does. Called on every playback change with the same state and
376
+ * actions the pill gets; return null to show no controls. Ignored outside
377
+ * slideshow mode, in render mode, and when `showControls` is false.
378
+ */
379
+ renderSlideshowControls?: (controls: SlideshowControlsProps) => ReactNode;
380
+ /**
381
+ * Video mode: draws the playback controls (play/pause, restart, time, the
382
+ * timeline, captions) in place of the overlay over the video — typically
383
+ * DocControlsCompact portaled into the host's chrome, as the editor's status
384
+ * bar does. Called on every playback change with the state and actions the
385
+ * overlay gets; return null to show no controls. Ignored in slideshow mode,
386
+ * in render mode, and when `showControls` is false.
387
+ */
388
+ renderPlaybackControls?: (controls: PlaybackControlsProps) => ReactNode;
334
389
  }
335
390
 
336
391
  /**
@@ -450,15 +505,6 @@ interface SocialCaptionOverlayProps {
450
505
  }
451
506
  declare function SocialCaptionOverlay({ captions, currentTime, enabled, theme, viewport, position, }: SocialCaptionOverlayProps): react.JSX.Element | null;
452
507
 
453
- interface DocControlsOverlayProps {
454
- state: PlaybackState;
455
- actions: PlaybackActions;
456
- blockMarkers: BlockMarker[];
457
- expandedBlocks: Block[];
458
- getBlockTitle?: (block: Block) => string;
459
- }
460
- declare function DocControlsOverlay({ state, actions, blockMarkers, expandedBlocks, getBlockTitle, }: DocControlsOverlayProps): react.JSX.Element;
461
-
462
508
  interface DocControlsBottomProps {
463
509
  state: PlaybackState;
464
510
  actions: PlaybackActions;
@@ -474,26 +520,6 @@ interface DocControlsSidebarProps {
474
520
  }
475
521
  declare function DocControlsSidebar({ state, actions }: DocControlsSidebarProps): react.JSX.Element;
476
522
 
477
- interface SlideshowPickerItem {
478
- /** Stable identifier for the slide/block. */
479
- id: string;
480
- /** Human-facing slide number, or a special label such as "Cover". */
481
- label: string;
482
- /** Short description shown in the slide picker. */
483
- summary: string;
484
- }
485
- interface DocControlsSlideshowProps {
486
- state: PlaybackState;
487
- slideNav: SlideNavActions;
488
- /** Slides available for direct navigation from the counter popover. */
489
- slides?: readonly SlideshowPickerItem[];
490
- /** Controlled open state for hosts that expose their own picker shortcut. */
491
- pickerOpen?: boolean;
492
- /** Called whenever the slide picker should open or close. */
493
- onPickerOpenChange?: (open: boolean) => void;
494
- }
495
- declare function DocControlsSlideshow({ state, slideNav, slides, pickerOpen, onPickerOpenChange, }: DocControlsSlideshowProps): react.JSX.Element;
496
-
497
523
  interface DocPlayerWithSidebarProps {
498
524
  /** The Doc to play */
499
525
  doc: Doc;
@@ -534,8 +560,10 @@ interface DocProgressBarProps {
534
560
  expandedBlocks: Block[];
535
561
  /** Optional: get block title for hover tooltip */
536
562
  getBlockTitle?: (block: Block) => string;
563
+ /** `overlay` (default): white, over the video. `inline`: compact, in the host's colors. */
564
+ variant?: 'overlay' | 'inline';
537
565
  }
538
- declare function DocProgressBar({ state, actions, blockMarkers, expandedBlocks, getBlockTitle, }: DocProgressBarProps): react.JSX.Element;
566
+ declare function DocProgressBar({ state, actions, blockMarkers, expandedBlocks, getBlockTitle, variant, }: DocProgressBarProps): react.JSX.Element;
539
567
 
540
568
  interface FlashcardViewProps {
541
569
  doc: Doc;
@@ -558,6 +586,52 @@ interface FlashcardViewProps {
558
586
  */
559
587
  density?: 'comfortable' | 'compact';
560
588
  className?: string;
589
+ /**
590
+ * Draws the deck's controls — Shuffle, Restart, Previous, the position and
591
+ * progress, and the card's actions (Reveal, or Again and Next) — in place of
592
+ * the deck's own, typically portaled into the host's chrome, as the editor's
593
+ * status bar does. The card then takes the height the controls used. Called
594
+ * on every change while the deck has cards; the end-of-session summary keeps
595
+ * its Retry missed and Study again buttons, which are that screen's content.
596
+ */
597
+ renderControls?: (controls: FlashcardControls) => ReactNode;
598
+ }
599
+ /** How a person rates a basic card once its answer shows. */
600
+ type FlashcardRating = 'again' | 'got-it';
601
+ /** What a host's flashcard controls draw from (`FlashcardView`'s `renderControls`). */
602
+ interface FlashcardControls {
603
+ /** The card on screen, 0-based in this session; `cardCount` once finished. */
604
+ cardIndex: number;
605
+ /** Cards in this session — only the missed ones while retrying. */
606
+ cardCount: number;
607
+ /** The card's answer is showing. */
608
+ revealed: boolean;
609
+ /** Every card is done and the summary is showing. */
610
+ finished: boolean;
611
+ /** The card on screen's kind; undefined once finished. */
612
+ cardKind?: Flashcard['kind'];
613
+ /** The card on screen is the session's last. */
614
+ lastCard: boolean;
615
+ /** How far through the session, 0–1 (a revealed answer counts its card). */
616
+ progress: number;
617
+ /** The cards are shuffled. */
618
+ shuffled: boolean;
619
+ /** Cards rated "Again" so far. */
620
+ missedCount: number;
621
+ /** Previous has somewhere to go. */
622
+ canGoBack: boolean;
623
+ /** Hide the answer, or go back a card (from the summary, to the last card). */
624
+ previous: () => void;
625
+ /** Reveal the answer, or — once it shows — go on without rating the card. */
626
+ next: () => void;
627
+ /** Rate a basic card whose answer shows, and go on. */
628
+ rate: (rating: FlashcardRating) => void;
629
+ /** Shuffle the cards, or put them back in order, and start over. */
630
+ toggleShuffle: () => void;
631
+ /** Start the session over. */
632
+ restart: () => void;
633
+ /** Study only the cards rated "Again". */
634
+ retryMissed: () => void;
561
635
  }
562
636
  interface FlashcardFaceViewProps {
563
637
  face: FlashcardFace;
@@ -571,7 +645,7 @@ interface FlashcardFaceViewProps {
571
645
  }
572
646
  /** Rich, theme-aware renderer for one materialized flashcard face. */
573
647
  declare function FlashcardFaceView(props: FlashcardFaceViewProps): react.JSX.Element;
574
- declare function FlashcardView({ doc, theme, basePath, source, shuffle: initialShuffle, globalKeyboardShortcuts, showCodeCopyButton, onCopyCode, fenceRenderers, viewport, density, className, }: FlashcardViewProps): react.JSX.Element;
648
+ declare function FlashcardView({ doc, theme, basePath, source, shuffle: initialShuffle, globalKeyboardShortcuts, showCodeCopyButton, onCopyCode, fenceRenderers, viewport, density, className, renderControls, }: FlashcardViewProps): react.JSX.Element;
575
649
 
576
650
  interface InlineVideoPlayerProps {
577
651
  /** Source path — resolved through MediaContext when relative. */
@@ -643,4 +717,4 @@ interface MediaClipLayerProps {
643
717
  }
644
718
  declare function MediaClipLayer({ schedule, currentTime, isPlaying, basePath, renderMode, muted, presentation, pipSize, pipShape, pipPosition, pipOrientation, pipFrameStyle, honorClipPresentation, }: MediaClipLayerProps): react.JSX.Element | null;
645
719
 
646
- export { type RenderChapterInfo as A, type BlockMarker as B, type CaptionMode as C, type DisplayMode as D, type RenderVideoFrameSelector as E, FlashcardFaceView as F, type SlideNavActions as G, SocialCaptionOverlay as H, InlineAudioPlayer as I, formatTime as J, MediaClipLayer as M, type PipSize as P, type RenderAudioSegmentInfo as R, type SquisqRenderAPI as S, type VideoPresentation as V, type PipShape as a, type PipPosition as b, BlockRenderer as c, CaptionOverlay as d, type CaptionPosition as e, type CaptionStyle as f, type ControlsLayout as g, DocControlsBottom as h, DocControlsOverlay as i, DocControlsSidebar as j, DocControlsSlideshow as k, DocPlayer as l, type DocPlayerProps as m, DocPlayerWithSidebar as n, DocProgressBar as o, type FlashcardFaceViewProps as p, FlashcardView as q, type FlashcardViewProps as r, type InlineAudioPlayerProps as s, InlineVideoPlayer as t, type InlineVideoPlayerProps as u, type MediaClipLayerProps as v, type PlaybackActions as w, type PlaybackState as x, type RenderBlockInfo as y, type RenderCaptionInfo as z };
720
+ export { type PlaybackState as A, type BlockMarker as B, type CaptionMode as C, type DisplayMode as D, type RenderBlockInfo as E, type FlashcardControls as F, type RenderCaptionInfo as G, type RenderChapterInfo as H, InlineAudioPlayer as I, type RenderVideoFrameSelector as J, type SlideNavActions as K, type SlideshowControlsProps as L, MediaClipLayer as M, type SlideshowPickerItem as N, SocialCaptionOverlay as O, type PlaybackControlsProps as P, formatTime as Q, type RenderAudioSegmentInfo as R, type SquisqRenderAPI as S, type VideoPresentation as V, type PipSize as a, type PipShape as b, type PipPosition as c, BlockRenderer as d, CaptionOverlay as e, type CaptionPosition as f, type CaptionStyle as g, type ControlsLayout as h, DocControlsBottom as i, DocControlsOverlay as j, DocControlsSidebar as k, DocControlsSlideshow as l, DocPlayer as m, type DocPlayerProps as n, DocPlayerWithSidebar as o, DocProgressBar as p, FlashcardFaceView as q, type FlashcardFaceViewProps as r, type FlashcardRating as s, FlashcardView as t, type FlashcardViewProps as u, type InlineAudioPlayerProps as v, InlineVideoPlayer as w, type InlineVideoPlayerProps as x, type MediaClipLayerProps as y, type PlaybackActions as z };