@bendyline/squisq-react 2.12.2 → 2.12.4

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,14 +1,15 @@
1
1
  import {
2
2
  BlockRenderer
3
- } from "../chunk-XSSIHHDY.js";
4
- import "../chunk-3RVUSY4V.js";
5
- import "../chunk-Z7OW6RGR.js";
3
+ } from "../chunk-PFKYO6C2.js";
4
+ import "../chunk-4ILJDBJ7.js";
5
+ import "../chunk-EY3DUCK7.js";
6
6
  import {
7
7
  renderMermaidSvgForExport
8
- } from "../chunk-HCKL2AFN.js";
8
+ } from "../chunk-JP2VHB5H.js";
9
9
 
10
10
  // src/export/diagramPictures.ts
11
11
  import { createElement } from "react";
12
+ import { flushSync } from "react-dom";
12
13
  import { createRoot } from "react-dom/client";
13
14
  import { VIEWPORT_PRESETS } from "@bendyline/squisq/schemas";
14
15
  import {
@@ -17,7 +18,7 @@ import {
17
18
  markdownToDoc,
18
19
  materializeBlockLayers
19
20
  } from "@bendyline/squisq/doc";
20
- import { parseMarkdown } from "@bendyline/squisq/markdown";
21
+ import { parseMarkdown, parseSvgIsland, svgIslandDataUrl } from "@bendyline/squisq/markdown";
21
22
  var EXPORT_FONT_STACK = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif";
22
23
  var EXPORT_MONO_STACK = "ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace";
23
24
  var CANVAS_UNITS_PER_CSS_PIXEL = 2.5;
@@ -33,7 +34,7 @@ function settings(options) {
33
34
  };
34
35
  }
35
36
  async function svgToPng(svg, width, height, options = {}) {
36
- const { scale, background } = settings(options);
37
+ const { scale } = settings(options);
37
38
  const pixelWidth = Math.max(1, Math.round(width * scale));
38
39
  const pixelHeight = Math.max(1, Math.round(height * scale));
39
40
  const clone = svg.cloneNode(true);
@@ -46,6 +47,12 @@ async function svgToPng(svg, width, height, options = {}) {
46
47
  const image = new Image();
47
48
  image.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(xml)}`;
48
49
  await image.decode();
50
+ return imageToPng(image, width, height, options);
51
+ }
52
+ async function imageToPng(image, width, height, options) {
53
+ const { scale, background } = settings(options);
54
+ const pixelWidth = Math.max(1, Math.round(width * scale));
55
+ const pixelHeight = Math.max(1, Math.round(height * scale));
49
56
  const canvas = document.createElement("canvas");
50
57
  canvas.width = pixelWidth;
51
58
  canvas.height = pixelHeight;
@@ -88,6 +95,17 @@ async function renderMermaidPicture(source, options = {}) {
88
95
  const width = Math.min(maxWidth, box.width);
89
96
  return svgToPng(svg, width, box.height * width / box.width, options);
90
97
  }
98
+ async function renderSvgIslandPicture(source, options = {}) {
99
+ const result = parseSvgIsland(source, { static: true });
100
+ if (!result.ok) return null;
101
+ const { theme, maxWidth } = settings(options);
102
+ const { island } = result;
103
+ const width = Math.min(maxWidth, island.width);
104
+ const image = new Image();
105
+ image.src = svgIslandDataUrl(island, { color: theme.colors.text });
106
+ await image.decode();
107
+ return imageToPng(image, width, island.height * width / island.width, options);
108
+ }
91
109
  async function renderTreePicture(source, options = {}) {
92
110
  const { theme, maxWidth } = settings(options);
93
111
  const lines = source.replace(/\s+$/u, "").split("\n");
@@ -129,10 +147,23 @@ function withExportFont(layer) {
129
147
  content: { ...layer.content, style: { ...layer.content.style, fontFamily: EXPORT_FONT_STACK } }
130
148
  };
131
149
  }
132
- async function settle() {
150
+ var SETTLE_TIMEOUT_MS = 1e3;
151
+ async function settle(host) {
133
152
  await document.fonts?.ready;
134
- for (let frame = 0; frame < 2; frame++) {
135
- await new Promise((resolve) => requestAnimationFrame(() => resolve()));
153
+ let changed = true;
154
+ const observer = new MutationObserver(() => {
155
+ changed = true;
156
+ });
157
+ observer.observe(host, { subtree: true, childList: true, attributes: true, characterData: true });
158
+ const deadline = Date.now() + SETTLE_TIMEOUT_MS;
159
+ try {
160
+ while (changed && Date.now() < deadline) {
161
+ changed = false;
162
+ await new Promise((resolve) => requestAnimationFrame(() => resolve()));
163
+ await new Promise((resolve) => setTimeout(resolve, 0));
164
+ }
165
+ } finally {
166
+ observer.disconnect();
136
167
  }
137
168
  }
138
169
  async function renderSquisqDiagramPicture(markdown, options = {}) {
@@ -159,19 +190,21 @@ async function renderSquisqDiagramPicture(markdown, options = {}) {
159
190
  audioSegment: 0,
160
191
  layers: kept
161
192
  };
162
- root.render(
163
- createElement(BlockRenderer, {
164
- block: pictureBlock,
165
- blockTime: 0,
166
- basePath: "",
167
- viewport,
168
- animationsEnabled: false,
169
- theme
170
- })
171
- );
172
- await settle();
193
+ flushSync(() => {
194
+ root.render(
195
+ createElement(BlockRenderer, {
196
+ block: pictureBlock,
197
+ blockTime: 0,
198
+ basePath: "",
199
+ viewport,
200
+ animationsEnabled: false,
201
+ theme
202
+ })
203
+ );
204
+ });
205
+ await settle(host);
173
206
  const svg = host.querySelector("svg.block-svg");
174
- if (!svg) return null;
207
+ if (!svg) throw new Error("The diagram rendered no SVG.");
175
208
  const box = svg.getBBox();
176
209
  if (box.width <= 0 || box.height <= 0) return null;
177
210
  const x = box.x - PADDING;
@@ -198,6 +231,8 @@ function createDiagramPictureRenderer(options = {}) {
198
231
  return renderMermaidPicture(diagram.source, options);
199
232
  case "tree":
200
233
  return renderTreePicture(diagram.source, options);
234
+ case "svg":
235
+ return renderSvgIslandPicture(diagram.source, options);
201
236
  default:
202
237
  return renderSquisqDiagramPicture(diagram.markdown, options);
203
238
  }
@@ -208,6 +243,7 @@ export {
208
243
  createDiagramPictureRenderer,
209
244
  renderMermaidPicture,
210
245
  renderSquisqDiagramPicture,
246
+ renderSvgIslandPicture,
211
247
  renderTreePicture,
212
248
  svgToPng
213
249
  };
@@ -187,16 +187,24 @@ declare function useResourcePolicy(): ResourcePolicy;
187
187
  * Returns null if no provider is set.
188
188
  */
189
189
  declare function useMediaProvider(): MediaProvider | null;
190
+ interface UseMediaUrlOptions {
191
+ /** For an SVG image: draw a still (no SMIL/CSS animation), for capture. */
192
+ staticSvg?: boolean;
193
+ }
190
194
  /**
191
195
  * Hook to resolve a media URL via the MediaProvider (if available),
192
196
  * falling back to basePath-based resolution.
193
197
  *
194
198
  * Returns the resolved URL string. Updates when the provider or path changes.
195
199
  *
200
+ * An SVG image (`logo.svg`, or an SVG `data:` URL) resolves to core's
201
+ * sanitized re-serialization of it — never the file as written — exactly as
202
+ * an SVG island is shown; see `sanitizedSvgImageUrl`.
203
+ *
196
204
  * @param relativePath - Relative media path from the document (e.g., 'hero.jpg')
197
205
  * @param basePath - Fallback base path for URL construction
198
206
  */
199
- declare function useMediaUrl(relativePath: string, basePath: string): string;
207
+ declare function useMediaUrl(relativePath: string, basePath: string, options?: UseMediaUrlOptions): string;
200
208
 
201
209
  /**
202
210
  * Live-track `prefers-color-scheme` and return a stable SurfaceScheme.
@@ -6,7 +6,7 @@ import {
6
6
  useDocPlayback,
7
7
  useMediaSchedule,
8
8
  useViewportOrientation
9
- } from "../chunk-AA6NGEP7.js";
9
+ } from "../chunk-3H6QBEYX.js";
10
10
  import {
11
11
  useAutoSurface
12
12
  } from "../chunk-TT6ENR6T.js";
@@ -16,7 +16,7 @@ import {
16
16
  useMediaProvider,
17
17
  useMediaUrl,
18
18
  useResourcePolicy
19
- } from "../chunk-HCKL2AFN.js";
19
+ } from "../chunk-JP2VHB5H.js";
20
20
  export {
21
21
  MediaContext,
22
22
  ResourcePolicyContext,
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as SquisqRenderAPI, V as VideoPresentation$1, P as PipSize, a as PipShape, b as PipPosition } from './player-Dnka50W4.js';
2
- export { B as BlockMarker, c as BlockRenderer, C as CaptionMode, d as CaptionOverlay, e as CaptionPosition, 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, w as PlaybackActions, x as PlaybackState, R as RenderAudioSegmentInfo, y as RenderBlockInfo, z as RenderCaptionInfo, A as RenderChapterInfo, E as RenderVideoFrameSelector, G as SlideNavActions, H as SocialCaptionOverlay, J as formatTime } from './player-Dnka50W4.js';
1
+ import { S as SquisqRenderAPI, V as VideoPresentation$1, P as PipSize, a as PipShape, b as PipPosition } from './player-BdckuwwB.js';
2
+ export { B as BlockMarker, c as BlockRenderer, C as CaptionMode, d as CaptionOverlay, e as CaptionPosition, 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, w as PlaybackActions, x as PlaybackState, R as RenderAudioSegmentInfo, y as RenderBlockInfo, z as RenderCaptionInfo, A as RenderChapterInfo, E as RenderVideoFrameSelector, G as SlideNavActions, H as SocialCaptionOverlay, J as formatTime } from './player-BdckuwwB.js';
3
3
  import { Theme, VideoPresentation, VideoPipSize, VideoPipShape, VideoPipPosition, MotionSpec, Doc, ScheduledClip, MediaProvider, Block, BuildCursor } from '@bendyline/squisq/schemas';
4
4
  import { DashboardStyleId, ViewportConfig, CoverSlideTemplate, CoverSlidePlayback } from '@bendyline/squisq/doc';
5
5
  export { getAnimationStyle, getTransitionClass } from '@bendyline/squisq/doc';
@@ -8,9 +8,9 @@ export { a as CodeBlockCopyContext, M as MarkdownRenderer, b as MarkdownRenderer
8
8
  export { FenceRendererContext, MermaidDiagram, MermaidDiagramProps, VideoEmbedFrame, VideoEmbedFrameProps, useFenceRenderers } from './markdown/index.js';
9
9
  export { CanvasSection, CanvasSectionProps, ImageDisplayMode, LinearDocView, LinearDocViewProps, PageSectionView, PageSectionViewProps, PageViewContext, PageViewContextValue, PaginatedDocPage, PaginatedDocView, PaginatedDocViewProps, usePageView } from './page/index.js';
10
10
  import * as react from 'react';
11
- import { RefObject } from 'react';
11
+ import { ReactNode, RefObject } from 'react';
12
12
  import { AnimatedImageInfo } from '@bendyline/squisq/imageEdit';
13
- export { ImageLayer, MapLayer, MermaidLayer, PathLayer, ShapeLayer, TextLayer, TreeLayer, VideoLayer } from './layers/index.js';
13
+ export { ImageLayer, MapLayer, MermaidLayer, PathLayer, ShapeLayer, SvgLayer, TextLayer, TreeLayer, VideoLayer } from './layers/index.js';
14
14
  export { T as TableLayer, a as TableLayerContentRenderer, b as TableLayerContentRendererProps } from './TableLayer-CA18rzIJ.js';
15
15
  export { MediaContext, MediaScheduleController, ModalDialogOptions, ResourcePolicyContext, UseDocPlaybackOptions, useAudioSync, useAutoSurface, useDocPlayback, useMediaProvider, useMediaSchedule, useMediaUrl, useModalDialog, useResourcePolicy, useViewportOrientation } from './hooks/index.js';
16
16
  export { FenceRenderContext, FenceRenderer, FenceRendererMap } from '@bendyline/squisq/fence';
@@ -175,6 +175,65 @@ interface DashboardViewProps {
175
175
  }
176
176
  declare function DashboardView({ doc, theme, viewport, layout, showTitle, style, documentTitle, basePath, animationsEnabled, muted, renderMode, onRenderAPIReady, className, }: DashboardViewProps): react.JSX.Element;
177
177
 
178
+ interface SvgIslandImageProps {
179
+ /** The fence body. */
180
+ source: string;
181
+ /** Rendered instead (with a short notice) when the source is not an island. */
182
+ fallback?: ReactNode;
183
+ /** Draw a still — no animation inside the island. Default: reduced motion. */
184
+ isStatic?: boolean;
185
+ /**
186
+ * The color `currentColor` resolves to. Default: the computed text color
187
+ * where the picture renders.
188
+ */
189
+ color?: string;
190
+ className?: string;
191
+ }
192
+ declare function SvgIslandImage({ source, fallback, isStatic, color, className, }: SvgIslandImageProps): react.JSX.Element;
193
+
194
+ /**
195
+ * An attached SVG image (`![logo](logo.svg)`) shown the way an SVG island is:
196
+ * its bytes run through core's sanitizer, and only core's re-serialization —
197
+ * sized from its viewBox, scripts and external references removed — reaches
198
+ * the page, as a `data:` URL.
199
+ *
200
+ * Only local sources are read: `blob:` and `data:` URLs (a media provider's
201
+ * output) and same-origin paths. A remote SVG keeps its own URL — an image of
202
+ * it already runs no script, and exports never carry remote images.
203
+ */
204
+ /** Whether `url` can be read without a cross-origin request. */
205
+ declare function isLocalSvgUrl(url: string): boolean;
206
+ interface SanitizedSvgImageOptions {
207
+ /** Draw a still: no SMIL or CSS animation (frame capture). */
208
+ static?: boolean;
209
+ }
210
+ /**
211
+ * Core's sanitized `data:` URL for the SVG at a local `url`, or `''` when it
212
+ * cannot be read or is not a usable SVG. Never rejects. Results are cached by
213
+ * URL — a media provider mints a new blob URL when a file changes.
214
+ */
215
+ declare function sanitizedSvgImageUrl(url: string, options?: SanitizedSvgImageOptions): Promise<string>;
216
+ /**
217
+ * For an SVG image at a local `url`: core's sanitized data URL of it, `null`
218
+ * when the file is not a usable SVG, `undefined` while it is being read.
219
+ * Any other `url` (not SVG, remote, empty) comes back as is.
220
+ *
221
+ * @param url - The resolved URL (a provider's blob/data URL, or a path).
222
+ * @param isSvg - Whether the image it names is SVG (see `isSvgImageSource`).
223
+ */
224
+ declare function useSanitizedSvgImage(url: string, isSvg: boolean, options?: SanitizedSvgImageOptions): string | null | undefined;
225
+
226
+ /**
227
+ * Wait for the pictures an SVG `<image>` shows to decode.
228
+ *
229
+ * Capture readiness checks have always awaited HTML `<img>` elements; an SVG
230
+ * `<image>` — an SVG island on a slide, an image layer in contain/fill mode —
231
+ * has no `decode()` of its own. Decoding the same URL through a detached
232
+ * `Image` warms the cache the `<image>` paints from. Only `data:` and `blob:`
233
+ * URLs are decoded, so this never starts a network request.
234
+ */
235
+ declare function decodeSvgImages(root: ParentNode): Promise<void>;
236
+
178
237
  type AnimatedImageStatus = 'playing' | 'paused' | 'ended';
179
238
  interface AnimatedImagePlayback {
180
239
  /** Inspection result: null while pending, for sources that cannot animate,
@@ -266,4 +325,4 @@ declare function useBuildNavigation(block: Block | null | undefined, enabled: bo
266
325
  showAll: () => void;
267
326
  };
268
327
 
269
- export { AnimatedImageControls, type AnimatedImageControlsProps, type AnimatedImagePlayback, type AnimatedImageStatus, CodeBlockCopyHandler, DashboardView, type DashboardViewProps, type DocPlayerAppearanceOverrides, type MountOptions, PipPosition, PipShape, PipSize, type ResolvedDocPlayerAppearance, type SquisqPlayerHandle, SquisqRenderAPI, VideoPresentation$1 as VideoPresentation, resolveDocPlayerAppearance, useAnimatedImage, useBuildNavigation, useMediaClipDurations };
328
+ export { AnimatedImageControls, type AnimatedImageControlsProps, type AnimatedImagePlayback, type AnimatedImageStatus, CodeBlockCopyHandler, DashboardView, type DashboardViewProps, type DocPlayerAppearanceOverrides, type MountOptions, PipPosition, PipShape, PipSize, type ResolvedDocPlayerAppearance, type SanitizedSvgImageOptions, type SquisqPlayerHandle, SquisqRenderAPI, SvgIslandImage, type SvgIslandImageProps, VideoPresentation$1 as VideoPresentation, decodeSvgImages, isLocalSvgUrl, resolveDocPlayerAppearance, sanitizedSvgImageUrl, useAnimatedImage, useBuildNavigation, useMediaClipDurations, useSanitizedSvgImage };
package/dist/index.js CHANGED
@@ -12,21 +12,22 @@ import {
12
12
  FlashcardView,
13
13
  MediaClipLayer,
14
14
  SocialCaptionOverlay,
15
+ decodeSvgImages,
15
16
  formatTime,
16
17
  resolveDocPlayerAppearance,
17
18
  useBuildNavigation,
18
19
  useMediaClipDurations
19
- } from "./chunk-NZMF2G7M.js";
20
+ } from "./chunk-F4YKXLEH.js";
20
21
  import {
21
22
  PaginatedDocView
22
- } from "./chunk-UNZSCTBU.js";
23
+ } from "./chunk-BJQCVANW.js";
23
24
  import {
24
25
  CanvasSection,
25
26
  LinearDocView,
26
27
  PageSectionView,
27
28
  PageViewContext,
28
29
  usePageView
29
- } from "./chunk-2K74UJ4T.js";
30
+ } from "./chunk-MGFMKGZY.js";
30
31
  import {
31
32
  useModalDialog
32
33
  } from "./chunk-JP457U6N.js";
@@ -35,11 +36,11 @@ import {
35
36
  useDocPlayback,
36
37
  useMediaSchedule,
37
38
  useViewportOrientation
38
- } from "./chunk-AA6NGEP7.js";
39
+ } from "./chunk-3H6QBEYX.js";
39
40
  import {
40
41
  JsonView,
41
42
  createJsonFormFenceRenderer
42
- } from "./chunk-XQSZ55EQ.js";
43
+ } from "./chunk-O2ZISYT3.js";
43
44
  import {
44
45
  useAutoSurface
45
46
  } from "./chunk-TT6ENR6T.js";
@@ -49,36 +50,41 @@ import {
49
50
  InlineAudioPlayer,
50
51
  InlineVideoPlayer,
51
52
  MarkdownRenderer,
53
+ SvgIslandImage,
52
54
  VideoEmbedFrame,
53
55
  useAnimatedImage,
54
56
  useFenceRenderers
55
- } from "./chunk-T7NVETOH.js";
57
+ } from "./chunk-YVQ7KEYI.js";
56
58
  import {
57
59
  BlockRenderer
58
- } from "./chunk-XSSIHHDY.js";
60
+ } from "./chunk-PFKYO6C2.js";
59
61
  import {
60
62
  ImageLayer,
61
63
  MapLayer,
62
64
  MermaidLayer,
63
65
  PathLayer,
64
66
  ShapeLayer,
67
+ SvgLayer,
65
68
  TableLayer,
66
69
  TextLayer,
67
70
  TreeLayer,
68
71
  VideoLayer,
69
72
  getAnimationStyle,
70
73
  getTransitionClass
71
- } from "./chunk-3RVUSY4V.js";
74
+ } from "./chunk-4ILJDBJ7.js";
72
75
  import {
73
76
  MermaidDiagram
74
- } from "./chunk-Z7OW6RGR.js";
77
+ } from "./chunk-EY3DUCK7.js";
75
78
  import {
76
79
  MediaContext,
77
80
  ResourcePolicyContext,
81
+ isLocalSvgUrl,
82
+ sanitizedSvgImageUrl,
78
83
  useMediaProvider,
79
84
  useMediaUrl,
80
- useResourcePolicy
81
- } from "./chunk-HCKL2AFN.js";
85
+ useResourcePolicy,
86
+ useSanitizedSvgImage
87
+ } from "./chunk-JP2VHB5H.js";
82
88
  export {
83
89
  AnimatedImageControls,
84
90
  BlockRenderer,
@@ -113,16 +119,21 @@ export {
113
119
  ResourcePolicyContext,
114
120
  ShapeLayer,
115
121
  SocialCaptionOverlay,
122
+ SvgIslandImage,
123
+ SvgLayer,
116
124
  TableLayer,
117
125
  TextLayer,
118
126
  TreeLayer,
119
127
  VideoEmbedFrame,
120
128
  VideoLayer,
121
129
  createJsonFormFenceRenderer,
130
+ decodeSvgImages,
122
131
  formatTime,
123
132
  getAnimationStyle,
124
133
  getTransitionClass,
134
+ isLocalSvgUrl,
125
135
  resolveDocPlayerAppearance,
136
+ sanitizedSvgImageUrl,
126
137
  useAnimatedImage,
127
138
  useAudioSync,
128
139
  useAutoSurface,
@@ -136,5 +147,6 @@ export {
136
147
  useModalDialog,
137
148
  usePageView,
138
149
  useResourcePolicy,
150
+ useSanitizedSvgImage,
139
151
  useViewportOrientation
140
152
  };
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  JsonView,
3
3
  createJsonFormFenceRenderer
4
- } from "../chunk-XQSZ55EQ.js";
4
+ } from "../chunk-O2ZISYT3.js";
5
5
  import "../chunk-TT6ENR6T.js";
6
- import "../chunk-T7NVETOH.js";
7
- import "../chunk-Z7OW6RGR.js";
8
- import "../chunk-HCKL2AFN.js";
6
+ import "../chunk-YVQ7KEYI.js";
7
+ import "../chunk-EY3DUCK7.js";
8
+ import "../chunk-JP2VHB5H.js";
9
9
  export {
10
10
  JsonView,
11
11
  createJsonFormFenceRenderer
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ImageLayer as ImageLayer$1, TextLayer as TextLayer$1, ShapeLayer as ShapeLayer$1, PathLayer as PathLayer$1, VideoLayer as VideoLayer$1, TreeLayer as TreeLayer$1, MapLayer as MapLayer$1, MermaidLayer as MermaidLayer$1, Theme } from '@bendyline/squisq/schemas';
2
+ import { ImageLayer as ImageLayer$1, TextLayer as TextLayer$1, ShapeLayer as ShapeLayer$1, PathLayer as PathLayer$1, VideoLayer as VideoLayer$1, TreeLayer as TreeLayer$1, MapLayer as MapLayer$1, MermaidLayer as MermaidLayer$1, Theme, SvgLayer as SvgLayer$1 } from '@bendyline/squisq/schemas';
3
3
  export { T as TableLayer, a as TableLayerContentRenderer, b as TableLayerContentRendererProps } from '../TableLayer-CA18rzIJ.js';
4
4
 
5
5
  interface ImageLayerProps {
@@ -15,8 +15,10 @@ interface ImageLayerProps {
15
15
  blockTime: number;
16
16
  /** Whether authored and responsive image motion should run. */
17
17
  animationsEnabled?: boolean;
18
+ /** Draw an SVG image as a still (no animation inside it), for capture. */
19
+ isStatic?: boolean;
18
20
  }
19
- declare function ImageLayer({ layer, basePath, viewport, blockTime, animationsEnabled, }: ImageLayerProps): react.JSX.Element;
21
+ declare function ImageLayer({ layer, basePath, viewport, blockTime, animationsEnabled, isStatic, }: ImageLayerProps): react.JSX.Element;
20
22
 
21
23
  interface TextLayerProps {
22
24
  layer: TextLayer$1;
@@ -114,4 +116,20 @@ interface MermaidLayerProps {
114
116
  /** Mermaid diagram hosted in HTML inside the slide SVG. */
115
117
  declare function MermaidLayer({ layer, viewport, blockTime, theme }: MermaidLayerProps): react.JSX.Element;
116
118
 
117
- export { ImageLayer, MapLayer, MermaidLayer, PathLayer, ShapeLayer, TextLayer, TreeLayer, VideoLayer };
119
+ interface SvgLayerProps {
120
+ layer: SvgLayer$1;
121
+ viewport: {
122
+ width: number;
123
+ height: number;
124
+ };
125
+ blockTime: number;
126
+ /**
127
+ * Draw a still: no SMIL or CSS animation inside the island. Set for frame
128
+ * capture (wall-clock animation would make frames nondeterministic),
129
+ * reduced motion, and disabled animations.
130
+ */
131
+ isStatic?: boolean;
132
+ }
133
+ declare function SvgLayer({ layer, viewport, blockTime, isStatic }: SvgLayerProps): react.JSX.Element;
134
+
135
+ export { ImageLayer, MapLayer, MermaidLayer, PathLayer, ShapeLayer, SvgLayer, TextLayer, TreeLayer, VideoLayer };
@@ -4,19 +4,21 @@ import {
4
4
  MermaidLayer,
5
5
  PathLayer,
6
6
  ShapeLayer,
7
+ SvgLayer,
7
8
  TableLayer,
8
9
  TextLayer,
9
10
  TreeLayer,
10
11
  VideoLayer
11
- } from "../chunk-3RVUSY4V.js";
12
- import "../chunk-Z7OW6RGR.js";
13
- import "../chunk-HCKL2AFN.js";
12
+ } from "../chunk-4ILJDBJ7.js";
13
+ import "../chunk-EY3DUCK7.js";
14
+ import "../chunk-JP2VHB5H.js";
14
15
  export {
15
16
  ImageLayer,
16
17
  MapLayer,
17
18
  MermaidLayer,
18
19
  PathLayer,
19
20
  ShapeLayer,
21
+ SvgLayer,
20
22
  TableLayer,
21
23
  TextLayer,
22
24
  TreeLayer,
@@ -3,11 +3,11 @@ import {
3
3
  MarkdownRenderer,
4
4
  VideoEmbedFrame,
5
5
  useFenceRenderers
6
- } from "../chunk-T7NVETOH.js";
6
+ } from "../chunk-YVQ7KEYI.js";
7
7
  import {
8
8
  MermaidDiagram
9
- } from "../chunk-Z7OW6RGR.js";
10
- import "../chunk-HCKL2AFN.js";
9
+ } from "../chunk-EY3DUCK7.js";
10
+ import "../chunk-JP2VHB5H.js";
11
11
  export {
12
12
  FenceRendererContext,
13
13
  MarkdownRenderer,
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  PaginatedDocView
3
- } from "../chunk-UNZSCTBU.js";
3
+ } from "../chunk-BJQCVANW.js";
4
4
  import {
5
5
  CanvasSection,
6
6
  LinearDocView,
7
7
  PageSectionView,
8
8
  PageViewContext,
9
9
  usePageView
10
- } from "../chunk-2K74UJ4T.js";
10
+ } from "../chunk-MGFMKGZY.js";
11
11
  import "../chunk-TT6ENR6T.js";
12
- import "../chunk-T7NVETOH.js";
13
- import "../chunk-XSSIHHDY.js";
14
- import "../chunk-3RVUSY4V.js";
15
- import "../chunk-Z7OW6RGR.js";
16
- import "../chunk-HCKL2AFN.js";
12
+ import "../chunk-YVQ7KEYI.js";
13
+ import "../chunk-PFKYO6C2.js";
14
+ import "../chunk-4ILJDBJ7.js";
15
+ import "../chunk-EY3DUCK7.js";
16
+ import "../chunk-JP2VHB5H.js";
17
17
  export {
18
18
  CanvasSection,
19
19
  LinearDocView,
@@ -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-Dnka50W4.js';
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-BdckuwwB.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,20 +12,20 @@ import {
12
12
  MediaClipLayer,
13
13
  SocialCaptionOverlay,
14
14
  formatTime
15
- } from "../chunk-NZMF2G7M.js";
16
- import "../chunk-2K74UJ4T.js";
17
- import "../chunk-AA6NGEP7.js";
15
+ } from "../chunk-F4YKXLEH.js";
16
+ import "../chunk-MGFMKGZY.js";
17
+ import "../chunk-3H6QBEYX.js";
18
18
  import "../chunk-TT6ENR6T.js";
19
19
  import {
20
20
  InlineAudioPlayer,
21
21
  InlineVideoPlayer
22
- } from "../chunk-T7NVETOH.js";
22
+ } from "../chunk-YVQ7KEYI.js";
23
23
  import {
24
24
  BlockRenderer
25
- } from "../chunk-XSSIHHDY.js";
26
- import "../chunk-3RVUSY4V.js";
27
- import "../chunk-Z7OW6RGR.js";
28
- import "../chunk-HCKL2AFN.js";
25
+ } from "../chunk-PFKYO6C2.js";
26
+ import "../chunk-4ILJDBJ7.js";
27
+ import "../chunk-EY3DUCK7.js";
28
+ import "../chunk-JP2VHB5H.js";
29
29
  export {
30
30
  BlockRenderer,
31
31
  CaptionOverlay,
@@ -389,8 +389,15 @@ interface BlockRendererProps {
389
389
  * `placeholder` poster with no remote thumbnail, for frame capture.
390
390
  */
391
391
  videoEmbeds?: VideoEmbedMode;
392
+ /**
393
+ * Draw media that animates on its own wall clock — SVG islands' SMIL and
394
+ * CSS animation — as a still. Set for frame capture, where such motion
395
+ * would make frames nondeterministic. Reduced motion and
396
+ * `animationsEnabled={false}` imply it.
397
+ */
398
+ staticMedia?: boolean;
392
399
  }
393
- declare function BlockRenderer({ block, buildPlayback, respectReducedMotion, blockTime, basePath, isEntering, isExiting, transition, viewport, isPlaying, muted, animationsEnabled, theme, tableContentRenderer, growTextToFit, videoEmbeds, }: BlockRendererProps): react.JSX.Element;
400
+ declare function BlockRenderer({ block, buildPlayback, respectReducedMotion, blockTime, basePath, isEntering, isExiting, transition, viewport, isPlaying, muted, animationsEnabled, theme, tableContentRenderer, growTextToFit, videoEmbeds, staticMedia, }: BlockRendererProps): react.JSX.Element;
394
401
 
395
402
  interface CaptionOverlayProps {
396
403
  /** Caption track with timestamped phrases */
@@ -527,6 +534,12 @@ interface FlashcardViewProps {
527
534
  fenceRenderers?: FenceRendererMap;
528
535
  /** Viewport used to materialize diagrams and other spatial content. */
529
536
  viewport?: ViewportConfig$1;
537
+ /**
538
+ * `compact` puts the title, position, and every control in one toolbar
539
+ * above a card with smaller type — for a deck embedded in a dialog or
540
+ * panel rather than given a page of its own. Default: 'comfortable'.
541
+ */
542
+ density?: 'comfortable' | 'compact';
530
543
  className?: string;
531
544
  }
532
545
  interface FlashcardFaceViewProps {
@@ -541,7 +554,7 @@ interface FlashcardFaceViewProps {
541
554
  }
542
555
  /** Rich, theme-aware renderer for one materialized flashcard face. */
543
556
  declare function FlashcardFaceView(props: FlashcardFaceViewProps): react.JSX.Element;
544
- declare function FlashcardView({ doc, theme, basePath, source, shuffle: initialShuffle, globalKeyboardShortcuts, showCodeCopyButton, onCopyCode, fenceRenderers, viewport, className, }: FlashcardViewProps): react.JSX.Element;
557
+ declare function FlashcardView({ doc, theme, basePath, source, shuffle: initialShuffle, globalKeyboardShortcuts, showCodeCopyButton, onCopyCode, fenceRenderers, viewport, density, className, }: FlashcardViewProps): react.JSX.Element;
545
558
 
546
559
  interface InlineVideoPlayerProps {
547
560
  /** Source path — resolved through MediaContext when relative. */