@bendyline/squisq-react 2.8.0 → 2.9.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.
@@ -593,7 +593,8 @@ function RichTextLayer({ layer, viewport, blockTime }) {
593
593
  ...animStyle.style
594
594
  };
595
595
  const cls = `squisq-rich-text-${cssId(layer.id)}`;
596
- const scopedCss = `.${cls}{margin:0}.${cls} p{margin:0 0 .4em}.${cls} h1,.${cls} h2,.${cls} h3,.${cls} h4,.${cls} h5,.${cls} h6{margin:0 0 .3em;line-height:1.2}.${cls} ul,.${cls} ol{margin:0 0 .4em;padding-left:1.2em;list-style-position:inside}.${cls} li{margin:0}.${cls} li>p{display:inline;margin:0}.${cls} *:first-child{margin-top:0}.${cls} *:last-child{margin-bottom:0}.${cls} a{color:inherit;text-decoration:underline}`;
596
+ const listStylePosition = style.textAlign === "center" || style.textAlign === "right" ? "inside" : "outside";
597
+ const scopedCss = `.${cls}{margin:0}.${cls} p{margin:0 0 .4em}.${cls} h1,.${cls} h2,.${cls} h3,.${cls} h4,.${cls} h5,.${cls} h6{margin:0 0 .3em;line-height:1.2}.${cls} ul,.${cls} ol{margin:0 0 .7em;padding-left:1.2em;list-style-position:${listStylePosition}}.${cls} li{margin:0}.${cls} li>p{display:inline;margin:0}.${cls} *:first-child{margin-top:0}.${cls} *:last-child{margin-bottom:0}.${cls} a{color:inherit;text-decoration:underline}`;
597
598
  return /* @__PURE__ */ jsx3("g", { className: `block-layer block-layer--text ${animStyle.className}`, "data-layer-id": layer.id, children: /* @__PURE__ */ jsx3(
598
599
  "foreignObject",
599
600
  {
@@ -9,7 +9,7 @@ import {
9
9
  TreeLayer,
10
10
  VideoLayer,
11
11
  getTransitionClass
12
- } from "./chunk-UJEHDVQO.js";
12
+ } from "./chunk-G6FVNYNW.js";
13
13
  import {
14
14
  useAutoSurface
15
15
  } from "./chunk-TT6ENR6T.js";
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { SquisqRenderAPI, VideoPresentation as VideoPresentation$1, PipSize, PipShape, PipPosition } from './player/index.js';
2
- export { BlockMarker, BlockRenderer, CaptionMode, CaptionOverlay, CaptionStyle, ControlsLayout, DisplayMode, DocControlsBottom, DocControlsOverlay, DocControlsSidebar, DocControlsSlideshow, DocPlayer, DocPlayerProps, DocPlayerWithSidebar, DocProgressBar, InlineAudioPlayer, InlineAudioPlayerProps, InlineVideoPlayer, InlineVideoPlayerProps, MediaClipLayer, MediaClipLayerProps, PlaybackActions, PlaybackState, RenderAudioSegmentInfo, RenderBlockInfo, RenderCaptionInfo, RenderChapterInfo, SlideNavActions, SocialCaptionOverlay, formatTime } from './player/index.js';
2
+ export { BlockMarker, BlockRenderer, CaptionMode, CaptionOverlay, CaptionStyle, ControlsLayout, DisplayMode, DocControlsBottom, DocControlsOverlay, DocControlsSidebar, DocControlsSlideshow, DocPlayer, DocPlayerProps, DocPlayerWithSidebar, DocProgressBar, FlashcardFaceView, FlashcardFaceViewProps, FlashcardView, FlashcardViewProps, InlineAudioPlayer, InlineAudioPlayerProps, InlineVideoPlayer, InlineVideoPlayerProps, MediaClipLayer, MediaClipLayerProps, PlaybackActions, PlaybackState, RenderAudioSegmentInfo, RenderBlockInfo, RenderCaptionInfo, RenderChapterInfo, SlideNavActions, SocialCaptionOverlay, formatTime } from './player/index.js';
3
3
  import { Theme, VideoPresentation, VideoPipSize, VideoPipShape, VideoPipPosition, Doc, ScheduledClip, MediaProvider } from '@bendyline/squisq/schemas';
4
4
  import { DashboardStyleId, ViewportConfig, CoverSlideTemplate, CoverSlidePlayback } from '@bendyline/squisq/doc';
5
5
  export { getAnimationStyle, getTransitionClass } from '@bendyline/squisq/doc';
@@ -44,9 +44,10 @@ import '@bendyline/squisq/jsonForm';
44
44
  interface MountOptions {
45
45
  /**
46
46
  * Rendering mode: 'slideshow' (interactive, default), 'static'
47
- * (scrollable page), or 'dashboard' (one canvas of arranged blocks).
47
+ * (scrollable page), 'dashboard' (one canvas of arranged blocks), or
48
+ * 'flashcards' (progressively revealed study deck).
48
49
  */
49
- mode?: 'slideshow' | 'static' | 'dashboard';
50
+ mode?: 'slideshow' | 'static' | 'dashboard' | 'flashcards';
50
51
  /** Dashboard-mode options (ignored by the other modes). */
51
52
  dashboard?: {
52
53
  /** Layout id or 'auto'. Overrides doc frontmatter. */
package/dist/index.js CHANGED
@@ -8,12 +8,14 @@ import {
8
8
  DocPlayer,
9
9
  DocPlayerWithSidebar,
10
10
  DocProgressBar,
11
+ FlashcardFaceView,
12
+ FlashcardView,
11
13
  MediaClipLayer,
12
14
  SocialCaptionOverlay,
13
15
  formatTime,
14
16
  resolveDocPlayerAppearance,
15
17
  useMediaClipDurations
16
- } from "./chunk-LAL43UUN.js";
18
+ } from "./chunk-2Y7F3S6M.js";
17
19
  import {
18
20
  BlockRenderer,
19
21
  CanvasSection,
@@ -21,7 +23,7 @@ import {
21
23
  PageSectionView,
22
24
  PageViewContext,
23
25
  usePageView
24
- } from "./chunk-IQGW6SA6.js";
26
+ } from "./chunk-NGQQKH7J.js";
25
27
  import {
26
28
  ImageLayer,
27
29
  MapLayer,
@@ -34,7 +36,7 @@ import {
34
36
  VideoLayer,
35
37
  getAnimationStyle,
36
38
  getTransitionClass
37
- } from "./chunk-UJEHDVQO.js";
39
+ } from "./chunk-G6FVNYNW.js";
38
40
  import {
39
41
  useModalDialog
40
42
  } from "./chunk-65POMKHR.js";
@@ -81,6 +83,8 @@ export {
81
83
  DocPlayerWithSidebar,
82
84
  DocProgressBar,
83
85
  FenceRendererContext,
86
+ FlashcardFaceView,
87
+ FlashcardView,
84
88
  ImageLayer,
85
89
  InlineAudioPlayer,
86
90
  InlineVideoPlayer,
@@ -8,7 +8,7 @@ import {
8
8
  TextLayer,
9
9
  TreeLayer,
10
10
  VideoLayer
11
- } from "../chunk-UJEHDVQO.js";
11
+ } from "../chunk-G6FVNYNW.js";
12
12
  import "../chunk-WLUZTUNZ.js";
13
13
  import "../chunk-LR3AIGDD.js";
14
14
  export {
@@ -4,8 +4,8 @@ import {
4
4
  PageSectionView,
5
5
  PageViewContext,
6
6
  usePageView
7
- } from "../chunk-IQGW6SA6.js";
8
- import "../chunk-UJEHDVQO.js";
7
+ } from "../chunk-NGQQKH7J.js";
8
+ import "../chunk-G6FVNYNW.js";
9
9
  import "../chunk-TT6ENR6T.js";
10
10
  import "../chunk-ESI3P77P.js";
11
11
  import "../chunk-WLUZTUNZ.js";
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { Block, VideoPresentation as VideoPresentation$1, VideoPipSize, VideoPipShape, VideoPipPosition, Doc, Theme, SurfaceScheme, Transition, CaptionTrack, ViewportConfig as ViewportConfig$1, ScheduledClip } from '@bendyline/squisq/schemas';
3
- import { ViewportConfig, DashboardStyleId, CoverSlideTemplate, CoverSlidePlayback } from '@bendyline/squisq/doc';
2
+ import { Block, VideoPresentation as VideoPresentation$1, VideoPipSize, VideoPipShape, VideoPipPosition, Doc, Theme, SurfaceScheme, Transition, CaptionTrack, ViewportConfig as ViewportConfig$1, CustomTemplateDefinition, ScheduledClip } from '@bendyline/squisq/schemas';
3
+ import { ViewportConfig, DashboardStyleId, CoverSlideTemplate, CoverSlidePlayback, FlashcardFace, FlashcardSourceMode } from '@bendyline/squisq/doc';
4
4
  import { FenceRendererMap } from '@bendyline/squisq/fence';
5
5
  import { a as AudioController } from '../AudioController-DwMsPe38.js';
6
6
  import { C as CodeBlockCopyHandler } from '../MarkdownRenderer-CC9dOc6b.js';
@@ -60,8 +60,10 @@ type PipPosition = VideoPipPosition;
60
60
  * - `'dashboard'` — One static canvas that arranges every block into a
61
61
  * layout's cells (grids, hero mosaics). No timeline, no navigation;
62
62
  * overflow blocks beyond the layout's capacity are not rendered.
63
+ * - `'flashcards'` — A progressively revealed study deck derived from the
64
+ * document's nested block hierarchy, including multiple-choice quizzes.
63
65
  */
64
- type DisplayMode = 'video' | 'slideshow' | 'linear' | 'page' | 'narrate' | 'dashboard';
66
+ type DisplayMode = 'video' | 'slideshow' | 'linear' | 'page' | 'narrate' | 'dashboard' | 'flashcards';
65
67
  /**
66
68
  * Caption display style.
67
69
  *
@@ -226,7 +228,7 @@ interface DocPlayerProps {
226
228
  forceViewport?: ViewportConfig;
227
229
  theme?: Theme;
228
230
  surface?: SurfaceScheme | 'auto';
229
- /** Video, manual slideshow, long-scrolling linear, or dashboard rendition. */
231
+ /** Video, slideshow, page, dashboard, or flashcards rendition. */
230
232
  displayMode?: DisplayMode;
231
233
  /** Dashboard mode: layout id or `'auto'`. Overrides doc frontmatter. */
232
234
  dashboardLayout?: string;
@@ -427,6 +429,36 @@ interface DocProgressBarProps {
427
429
  }
428
430
  declare function DocProgressBar({ state, actions, blockMarkers, expandedBlocks, getBlockTitle, }: DocProgressBarProps): react_jsx_runtime.JSX.Element;
429
431
 
432
+ interface FlashcardViewProps {
433
+ doc: Doc;
434
+ theme?: Theme;
435
+ basePath?: string;
436
+ source?: FlashcardSourceMode;
437
+ /** Start the deck in shuffled order (default false). */
438
+ shuffle?: boolean;
439
+ /** Capture shortcuts without requiring focus (default false). */
440
+ globalKeyboardShortcuts?: boolean;
441
+ showCodeCopyButton?: boolean;
442
+ onCopyCode?: CodeBlockCopyHandler;
443
+ fenceRenderers?: FenceRendererMap;
444
+ /** Viewport used to materialize diagrams and other spatial content. */
445
+ viewport?: ViewportConfig$1;
446
+ className?: string;
447
+ }
448
+ interface FlashcardFaceViewProps {
449
+ face: FlashcardFace;
450
+ theme: Theme;
451
+ basePath: string;
452
+ showCodeCopyButton: boolean;
453
+ onCopyCode?: CodeBlockCopyHandler;
454
+ fenceRenderers?: FenceRendererMap;
455
+ viewport?: ViewportConfig$1;
456
+ customTemplates?: readonly CustomTemplateDefinition[];
457
+ }
458
+ /** Rich, theme-aware renderer for one materialized flashcard face. */
459
+ declare function FlashcardFaceView(props: FlashcardFaceViewProps): react_jsx_runtime.JSX.Element;
460
+ declare function FlashcardView({ doc, theme, basePath, source, shuffle: initialShuffle, globalKeyboardShortcuts, showCodeCopyButton, onCopyCode, fenceRenderers, viewport, className, }: FlashcardViewProps): react_jsx_runtime.JSX.Element;
461
+
430
462
  interface InlineVideoPlayerProps {
431
463
  /** Source path — resolved through MediaContext when relative. */
432
464
  src: string;
@@ -486,4 +518,4 @@ interface MediaClipLayerProps {
486
518
  }
487
519
  declare function MediaClipLayer({ schedule, currentTime, isPlaying, basePath, renderMode, muted, presentation, pipSize, pipShape, pipPosition, pipOrientation, pipFrameStyle, honorClipPresentation, }: MediaClipLayerProps): react_jsx_runtime.JSX.Element | null;
488
520
 
489
- export { type BlockMarker, BlockRenderer, type CaptionMode, CaptionOverlay, type CaptionStyle, CodeBlockCopyHandler, type ControlsLayout, type DisplayMode, DocControlsBottom, DocControlsOverlay, DocControlsSidebar, DocControlsSlideshow, DocPlayer, type DocPlayerProps, DocPlayerWithSidebar, DocProgressBar, InlineAudioPlayer, type InlineAudioPlayerProps, InlineVideoPlayer, type InlineVideoPlayerProps, MediaClipLayer, type MediaClipLayerProps, type PipPosition, type PipShape, type PipSize, type PlaybackActions, type PlaybackState, type RenderAudioSegmentInfo, type RenderBlockInfo, type RenderCaptionInfo, type RenderChapterInfo, type SlideNavActions, SocialCaptionOverlay, type SquisqRenderAPI, type VideoPresentation, formatTime };
521
+ export { type BlockMarker, BlockRenderer, type CaptionMode, CaptionOverlay, type CaptionStyle, CodeBlockCopyHandler, type ControlsLayout, type DisplayMode, DocControlsBottom, DocControlsOverlay, DocControlsSidebar, DocControlsSlideshow, DocPlayer, type DocPlayerProps, DocPlayerWithSidebar, DocProgressBar, FlashcardFaceView, type FlashcardFaceViewProps, FlashcardView, type FlashcardViewProps, InlineAudioPlayer, type InlineAudioPlayerProps, InlineVideoPlayer, type InlineVideoPlayerProps, MediaClipLayer, type MediaClipLayerProps, type PipPosition, type PipShape, type PipSize, type PlaybackActions, type PlaybackState, type RenderAudioSegmentInfo, type RenderBlockInfo, type RenderCaptionInfo, type RenderChapterInfo, type SlideNavActions, SocialCaptionOverlay, type SquisqRenderAPI, type VideoPresentation, formatTime };
@@ -7,14 +7,16 @@ import {
7
7
  DocPlayer,
8
8
  DocPlayerWithSidebar,
9
9
  DocProgressBar,
10
+ FlashcardFaceView,
11
+ FlashcardView,
10
12
  MediaClipLayer,
11
13
  SocialCaptionOverlay,
12
14
  formatTime
13
- } from "../chunk-LAL43UUN.js";
15
+ } from "../chunk-2Y7F3S6M.js";
14
16
  import {
15
17
  BlockRenderer
16
- } from "../chunk-IQGW6SA6.js";
17
- import "../chunk-UJEHDVQO.js";
18
+ } from "../chunk-NGQQKH7J.js";
19
+ import "../chunk-G6FVNYNW.js";
18
20
  import "../chunk-MVJQL2W2.js";
19
21
  import "../chunk-TT6ENR6T.js";
20
22
  import {
@@ -33,6 +35,8 @@ export {
33
35
  DocPlayer,
34
36
  DocPlayerWithSidebar,
35
37
  DocProgressBar,
38
+ FlashcardFaceView,
39
+ FlashcardView,
36
40
  InlineAudioPlayer,
37
41
  InlineVideoPlayer,
38
42
  MediaClipLayer,